1. Document operations
Internal insertion
A.append (b) Bar B add to the back of a
A.appendto (b) Bar A add to the back of B
A.prepend (b) Bar B add to the front of a
A.prependto (b) Bar A add to the front of B
External insert
A.after (b) Bar B add to the back of a
A.insertafter (b) Bar A add to the back of B
A.before (b) Bar B add to the front of a
A.insertbefore (b) bar A add to the front of B
2. Cloning operations
$ (selector). Clone ();
Cases
<! DOCTYPE html> $ (". C1"). On ("click",function () { $ () ). Clone (True). InsertAfter ($ (this)) })</script></body></ Html>
3. Replace operation
ReplaceWith (CONTENT|FN)
A.replacewith (b)-- B Replace a
ReplaceAll (selector)
A.replaceall (b)-- a replace B
// Replace all H5 titles with a label $ (' h5 '). ReplaceWith (' <a href= ' # ">hello world</a> ')// Replace all H5 header tags with the DOM element ID for app $ (' h5 '). ReplaceWith ($ (' #app '));
4. Delete operation
When the node is deleted, the entire label is deleted
$ (' ul '). Remove ();
When a node is deleted, the event remains
Clears all descendants in the selected element child node
// EMPTY the UL sub-elements and keep the UL$ (' ul '). Empty ()
38. Document operation of the front-end jquery