html代码:
<div id="main">
<div>1</div>
<div>1</div>
</div>
js代码:
<script>
$(function(){
$("#main").append("<div></div>")
});
</script>
删除元素
$(“id”).remove();//获取到要删除的元素,然后调用remove()方法
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
时间: 2024-10-16 03:23:48