Jquery what is the difference remove from detach?

I have not read one article, I tried an example from here:
detach
tried to replace the detach method to remove and the result is the same, also examples from other sites have no difference in these methods, I of course realized that:
remove - completely removes the element from DOM without refund
detach - removes the element from the DOM(but later it can be restored to the page)
August 23rd 19 at 10:31
1 answer
August 23rd 19 at 10:33
Solution
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.
> PS 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.

To fasten separately will have only the events and the attributes/classes are still valid, which attributes and classes you mean? - Arch_Ledner53 commented on August 23rd 19 at 10:36
those who were at the element BEFORE it was deleted. In the example, the link (courtesy of the author of the question) when you click on a paragraph, he switches the class "off" (on/off.off) when "return" element in place of the class (or lack thereof) is preserved. When you add an item to the "standard" way (without distortions) - the element is in a basic form, i.e. either with this class or without him. - Jocelyn.Jakubowski43 commented on August 23rd 19 at 10:39

Find more questions by tags jQuery