You can achieve this by using the appendTo() method to move the element and then using the remove() method to remove it from its original position. Here is an example:

HTML:

<div id="parent1">
  <div id="child">Move me</div>
</div>

<div id="parent2"></div>

JavaScript (jQuery):

$(document).ready(function() {
  // Move the div with id "child" to parent2
  $("#child").appendTo("#parent2");
  
  // Remove the div from parent1
  $("#parent1 #child").remove();
});

In this example, the appendTo() method is used to move the div with id "child" to the parent div with id "parent2". Then, the remove() method is used to remove the div from its original parent div with id "parent1"

move or cut div to another parent by jquery and remove in last position i dont want to copy i just want to cut

原文地址: https://www.cveoy.top/t/topic/isWX 著作权归作者所有。请勿转载和采集!

免费AI点我,无需注册和登录