@1.empty () deletes all descendant byte point elements in the matching element collection ;
<p>hello<span>world</span></p>
$ ("P"). empty (); <p></p>
@2.remove ([expr]) receives a parameter that deletes the specified element
$ ("P"). Remove () Delete all paragraphs
$ ("P"). Remove (". Hel") deletes a paragraph with a. Hel class name
This method does not remove the matching elements from the jquery object, so that the matching elements can be used in the future. Except that the element itself is preserved, other things such as bound events, attached data, etc. are removed .
@3.detach ([Expre]) removes all matching elements from the DOM
This method does not remove the matching elements from the jquery object, so that the matching elements can be used in the future. Unlike remove (), all bound events, attached data, and so on will remain
<body>
<div id= "Google" >Google</div>
<div id= "Apple" >Apple</div>
</body>
<script type= "Text/javascript" >
$ (function () {
$ ("#apple"). Hover (function () {
$ (this). Text ("Google +");
});
Apple = $ ("#apple"). Remove (); <!--//Use the Remove () hover () event will also be removed-
/*apple = $ ("#apple"). Detach ();*/<!--//using the detach () hover () event is saved--
$ ("Body"). Append (Apple);
});
</script>
The jQuery element removes the difference between empty () remove () and detach ()?