最佳答案
$( "button" ).click(function() {
$( "#test2" ).unwrap();
});
The .unwrap() method removes the element's parent. This is effectively the inverse of the .wrap() method. The matched elements (and their siblings, if any) replace their parents within the DOM structure.
关于javascript - 如何在不删除其子项的情况下删除 div?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/32919358/