Functions / Manipulation
Manipulation
Manipulating DOM elements. 12 snippets.
- Append or prepend to an element
$.append(), $.appendTo(), $.prepend(), $.prependTo() - Clone an element
$.clone() - Create a DOM element
$(string) - Empty an element’s content
$.empty() - Insert an element after or before another
$.after(), $.before(), $.insertAfter(), $.insertBefore - Removing an element
$.remove(), $.detach() - Replace a DOM element
$.replaceAll(), $.replaceWith() - Unwrap a DOM element
$.unwrap() - Wrap an HTML structure around an element
$.wrap(), $.wrapAll()
The other groups: