- empty() removes all child elements and other child nodes (such as text nodes) from each element in the matched set, leaving the selector element empty
- remove() removes matched elements and child nodes, deletes all jQuery data and events associated with the removed elements
- detach() behaves exactly like remove(), except that it doesn't delete the jQuery data and events associated with the removed elements (for later use)
- unwrap() function removes the parent of an element (or the parents of a set of elements) from the DOM
- replaceWith() lets you replace an element, or set of elements, with new content.
- replaceAll() does the same job as replaceWith(), but you pass in the elements that you want to replace
- Adding content at the start of an element (or elements) with prepend() and prependTo()
- Adding content at the end of an element (or elements) with append() and appendTo()
- Adding content before an element (or elements) with before() and insertBefore()
- Adding content after an element (or elements) with after() and insertAfter()
- Wrapping content around an element (or elements), or around an element's contents, with wrap(), wrapAll() and wrapInner()
Wednesday, August 29, 2012
Manipulate Element in jQuery
Here are some frequently used functions in jQuery to handle DOM elements
Labels:
jquery
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment