Add Div Dynamically using JQuery

后端 未结 5 683
庸人自扰
庸人自扰 2021-02-13 09:54

I\'m not sure if this would be the best option.. But I want the option that when the user clicks a button, it will add another div or li.

I am going to allow users to u

5条回答
  •  深忆病人
    2021-02-13 10:19

    $("input[type=submit]").click(function(){
        $("
  • ").html("item").appendTo("ul"); })
  • You can create elements using $("") and set attributes, add classes and so on. Then append where you want.

提交回复
热议问题