Document Processing is to add html content to the dom element.
1,
$ ("P"). append ("<a href = 'www .baidu.com '> baidu </a>"); add content to the p tag.
2,
$ ("P"). appendTo ("div"); add all p elements to the div.
3,
$ ("P"). prepend ("<B> Hello </B>"); add all B elements before p.
4,
$ ("P"). prependTo ("# foo"); add p to id foo ..
5,
$ ("P"). after ($ ("B"); add p to the end of B
6,
$ ("P"). before ("<B> Hello </B>"); insert html before all p elements
7,
$ ("P"). insertAfter ("# foo"); insert p to the end of the element whose id is foo.
8,
$ ("P"). insertBefore ("# foo ");
$ ("# Foo"). before ("p") operations are the same. before inserting all elements into one element
9,
$ ("P"). wrap ("<div class = 'wrapp'> </div>"); wrap all p with div
10,
$ ("P"). unwrap () Remove the parent element of the p element
11,
$ ("P"). wrapAll (document. createElement ("div"); wrap all p
12,
$ ("<B> Paragraph. </B>"). replaceAll ("p"); replace all p
13,
$ ("P"). empty (); Delete All subnodes in the p set
14,
$ ("P"). remove (); remove all p elements from the set
15,
$ ("P"). detach (". hello"); remove a paragraph with a hello class from the DOM
16,
$ ("B"). clone (). prependTo ("p"); copy Element B and add it to p.
Author: pingpang