In addition to creating and inserting content, we can alter the current content of a page. jQuery has functions that let you specify what content needs to be altered:
wrap()
: wrap the matched elements with the specified contentwrapAll()
: wrap content around the matched elements as a groupunWrap()
: remove the parents from the matched elementsempty()
: remove all the child elements from the matched elementsremove()
: removes elements from the page, including any embedded data and event handlersdetach()
: removes elements from the page, but maintains embedded data and event handlersreplaceAll()
: replaces the matched elements with the specified contentreplaceWith()
: replaces matched elements with content or the results of a callback functionThis is paragraph 1
This is paragraph 2
This is paragraph 3
This is paragraph 4
This is paragraph 5