当我使用 $("child").remove() 或 $("child").empty() 时,它会从页面中删除所有子元素,我希望它只从一个父元素中删除子元素。这个页面上有更多的父类,所以无论如何我可以在用户单击按钮类时仅从父类中删除内容.. button_parent 类与父类处于同一级别
<div class ="button_parent"><div class ="button"></div></div>
<div class = "parent">
<div class= "child"></div>
<div class= "child"></div>
<div class= "child"></div>
<div class= "child"></div>
</div>
<div class ="button_parent"><div class ="button"></div></div>
<div class = "parent">
<div class ="button"></div>
<div class= "child"></div>
<div class= "child"></div>
<div class= "child"></div>
<div class= "child"></div>
</div>
<div class ="button_parent"><div class ="button"></div></div>
<div class = "parent">
<div class ="button"></div>
<div class= "child"></div>
<div class= "child"></div>
<div class= "child"></div>
<div class= "child"></div>
</div>
<div class ="button_parent"><div class ="button"></div></div>
<div class = "parent">
<div class ="button"></div>
<div class= "child"></div>
<div class= "child"></div>
<div class= "child"></div>
<div class= "child"></div>
</div>
<div class ="button_parent"><div class ="button"></div></div>
<div class = "parent">
<div class ="button"></div>
<div class= "child"></div>
<div class= "child"></div>
<div class= "child"></div>
<div class= "child"></div>
</div>
<div class ="button_parent"><div class ="button"></div></div>
<div class = "parent">
<div class ="button"></div>
<div class= "child"></div>
<div class= "child"></div>
<div class= "child"></div>
<div class= "child"></div>
</div>