Home >Web Front-end >JS Tutorial >Example of use of remove() method in jQuery_jquery
The example in this article describes the usage of the remove() method in jQuery. Share it with everyone for your reference. The specific analysis is as follows:
This method will remove all matching elements from the DOM.
Note: The remove() method will not delete the matching elements from the jQuery object, so these matching elements can be used again in the future, but except for the element itself, other For example, bound events, additional data, etc. will be removed.
Grammar structure:
Parameter list:
Example 1:
The following code can delete the div with id first in the div collection.
Example 2:
If the parameter is omitted, all matching elements will be deleted.
Example 3:
remove() has removed the matching element in the DOM, but it has not removed it from the jquery object.
I hope this article will be helpful to everyone’s jQuery programming.