html代码:
<div id="main">
<div>1</div>
<div>1</div>
</div>
js代码:
<script>
$(function(){
$("#main").append("<div></div>")
});
</script>
删除元素
$(“id”).remove();//获取到要删除的元素,然后调用remove()方法
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
<<< jquery向id元素后面动态添加元素,古老的榕树,5-wow.com