我正在使用一个插件,但我不知道从哪里重复相同的 div。所以我试图删除重复的 div
假设我有以下标记......
<div id="main">
<div>
<div>
<div>
<p class="test">hi this is test</p>
</div>
<div>
<p class="test">hi this is test</p>
</div>
</div>
</div>
</div>
jQuery
/*how can I forcefully remove this so that later on this div cannot be cloned*/
$('.test').closest('div').next().remove();
/* suppose this is in plugin */
$('.test').clone().appendTo('#main');