Method |
Describe |
Example |
Append () |
Append content to each matching element |
HTML code:<p> I want to say:</p>. jquery Code: $ ("P"). Append ("<b> hello </b>"); Results: <p> I want to say:<b> Hello </b></p> |
appendto () |
Append all matching elements to the specified element . In fact, using this method is reversed for $ (A) for general . Append (b) is the operation of appending A to B. |
HTML code: <p> I want to say: </p jquery code: $ ("<b> Hello </b>"). AppendTo ("P") result: <p> I want to say:<b> hello </b></p> |
prepend () |
to each matching element internal Front content |
html code:<p> I want to say: </p> result: <p><b> Hello </b> I want to say: </p> |
prependto () |
Put all matching elements in front of the specified element . In fact, using this method reverses the General $ (A). prepend (B) operation. |
HTML code:<p> I want to say: </p> jquery Code: result: <p><b> Hello </b> I want to say: </p> |
after () |
|
jquery code: $ ("P"). After ("<b> Hello < /b> ") result: <p> I want to say:</p><b> hello </b> |
insertafter () |
Inserts all matching elements into the specified element After , in fact, using the method is reversed for the regular $ (A). After (B) operation |
html code:<p> I want to say: </p> $ ("<b> Hello </b>"). InsertAfter ("P") result: <p> I want to say:</p><b> hello </b> |
before () |
|
jquery code: $ ("P"). Before ("<b> Hello </b> ") result: <b> Hello </b><p> I want to say: </p> |
InsertBefore () |
Inserts so that the matching element is inserted into the reference The front of the set element. As a matter of fact Using this method is reversed by the general The operation of the $ (A). Before (B). |
HTML code:<p> I want to say:</p>. jquery Code: $ ("<b> Hello </b>"). InsertBefore ("P") Results: <b> Hello </b><p> i want to say:</p> |
How jquery Inserts a node