The .detach() method is the same as .remove(), except that .detach() keeps all jQuery data associated with the removed elements. This method is useful when removed elements are to be reinserted into the DOM at a later time.detach
- the same as remove
, except that detach
keeps all the data associated with the removed elements. This method can be used to re-insert deleted items into the "HOUSE" later.
As I understand, and as you can see, the link You gave - when you remove and re-insert these elements back JQuery stores all item properties, including sozherzhimoe, attributes (including current classes) and So on, these elements apparently remain bound to these events.
P. S. If You simply remove the element, and then insert new insert new item events it will have to re-tie, re-set the attributes/classes etc., with a detach
- element "return" in the form in which it was removed, i.e., will return the element that was. When removing/inserting a - will be inserted in the new element.
P. P. S. ie almost the same as to hide the [hide()/show() in JQuery or diplay: block/none CSS], which would then show only physically in the DOM tree that is no longer present.