Jquery operations on DOM elements (2). after ()
Insert the content specified by the parameter after each element in the matched element set as its sibling node.
. After (content [, content])
Content HTML string DOM element array object, used to insert to the end of each Matching Element in the set.
Content HTML string DOM element array object, used to insert to the end of each Matching Element in the set.
. After (function)
Function returns an array of DOM element elements of an HTML string, which is inserted after each Matching Element in the set. This points to the current position.
Structure:
Greetings
Hello
Goodbye
$ ('. Inner'). after ('
Test
');
Effect:
Greetings
Hello
Test
Goodbye
Test
. Before ()
Insert content before matching parameters according to parameter settings.
. After (content [, content])
Content HTML string DOM element array object, used to insert to the end of each Matching Element in the set.
Content HTML string DOM element array object, used to insert to the end of each Matching Element in the set.
. After (function)
Function returns an array of DOM element elements of an HTML string, which is inserted after each Matching Element in the set. This points to the current position.
Structure:
Greetings
Hello
Goodbye
$ ('. Inner'). before ('
Test
');
Effect:
Greetings
Test
Hello
Test
Goodbye
. InsertAfter ()
Insert each Matching Element in the set after the target element. The inserted element serves as the sibling element of the target element.
. InsertAfter (target)
Target a selector, element, HTML string or object. matched elements are inserted after the target specified by the parameter.
Structure:
Greetings
Hello
Goodbye
$ ("
Test
"). InsertAfter ('. insertAfter ');
Effect:
Greetings
Hello
Test
Goodbye
Test
. InsertBefore ()
Insert each Matching Element in the set before the target element. The inserted element serves as the sibling element of the target element.
. InsertBefore (target)
Target a selector, element, HTML string or object. matched elements are inserted before the target specified by the parameter.
Structure:
Greetings
Hello
Goodbye
$ ("
Test
"). InsertBefore ('. insertAfter ');
Effect:
Greetings
Test
Hello
Test
Goodbye
The above is the content of jquery DOM element (2). For more articles, please follow the PHP Chinese Web (www.php1.cn )!