1. before (): Add the new node to the front
2. after (): add the node to the lower part
3. prepend (): Change the node to the first node.
4. append (): adds a new node to the end, which has the same effect as appendTo (), but has syntax differences.
5. remove (): remove nodes
Example:
<Ul>
<Li class = "vacation">
<H2> Hawaiian Vac <Button> Get Price </button>
</Li>
</Ul>
Implementation:
<Script type = "text/javascript">
$ (Document). ready (function (){
$ ('. Vacation'). before (price); // Add the new node to the front
$ ('. Vacation'). after (price); // Add the node to the lower part
$ ('. Vacation'). prepend (price); // change the node to the first section of <li>
Var price = $ ('<p> From $399.99 </p>'); // create a dom in JQuery
// $ ('. Vacation '). append (price); // Add the new node to the end, equal to the price. appendTo ($ ('. vacation ');, syntax is different
Price. appendTo ($ ('. vacation'); // Add the new node to the end
$ ('Button '). remove (); // remove a node
});
</Script>