How to remove original element after it was cloned?
问题 HTML: <div id="test"> <p class="test1">test 1</p> <p class="test2">test 2</p> <p class="test3">test 3</p> <p class="test4">test 4</p> </div> <div class="clickdiv">click</div> jQuery $('.clickdiv').on('click', function(){ $('.test1').clone().appendTo('#test'); } This will result one more <p> with class = "test1" . Now how can I remove the original one that is first one? 回答1: I don't know why you can't just append the element to the parent, instead of cloning it then removing it. Anyway $('