我正在使用一个插件,我不知道从哪里重复同一个div。所以我想删除重复的div如何用jquery强制删除元素?
假设我有以下标记.....
<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');
问题是那么??,它的工作,你只是还没有包括jQuery的 – Rex
jQuery是不包括在内的F iddle http://jsfiddle.net/arunpjohny/HeHks/1/ –
@ArunPJohny哦!对不起,我会更新...谢谢 –