jQuery HTMLLesson 17Free preview
jQuery Remove
This lesson is part of jQuery · All levels
Summary
The Remove method is used to remove elements or content from a page. remove() removes elements and all content from the DOM, whereas empty() only empties the content inside. The choice between the two depends on whether the element will be used again later.
Key points
- Remove the elements and their entire descendants from the DOM
- Empty the contents of the element but the element remains
- Elements that have been deleted cannot be displayed again with show()
- After removal, the event on the element goes missing.
- Removal should be targeted so as not to touch other elements
Full lesson
Code examples and quizzes
Full lessons, code examples, and quizzes are available to subscribers. 5 questions.