In Adding Elements to the Page in jQuery, you explored a number of ways to add new HTML elements — such as paragraphs and images — to a page. In this tutorial you learn how to manipulate existing elements in the page, including:
- Removing elements from the page using the
empty()
,remove()
,detach()
andunwrap()
methods - Replacing elements with new elements by using the
replaceWith()
andreplaceAll()
methods, and - How to move an element from one parent element in the page to another.
Once you’ve read this tutorial, you’ll have mastered all the jQuery techniques you need to manipulate elements in the DOM.
[Read more…] about Removing, Replacing and Moving Elements in jQuery