1. Attribute operation 1) Search for the attribute node: the attr () method to obtain the attribute value. Its parameters can be one or more. For example: attr (& quot; title & quot;) // obtain the attribute value attr (& quot; title & quot;, & quot; aaaaaaaaa & quot;) // change the attribute value to aaaaaaaaa; 2) removeAttr () delete Method
1. Attribute operation 1) Search for the attribute node: the attr () method to obtain the attribute value. Its parameters can be one or more. For example, attr ("title ") // obtain the attribute value attr ("title", "aaaaaaaaa") // change the attribute value to aaaaaaaaa; 2) removeAttr () method to delete the element attribute;
2. Create a node: var $ lia = $ ("
Aaaaa")
3. Insert node: append () directly; appendTo () append to Example. appendTo (B) means that A is appended to B, and the order is the opposite of append (); prepend () is inserted to the front of the element (opposite to after ();. prependTo (B) describes how A is inserted before B (opposite to insertAfter );
4. Method for deleting a node: remove (). After deletion, you can continue to use these elements. For example, $ aa =$ ("ul li: eq (1)"); $ aa. remove (); $ ("ul "). append ("$ aa"); the empty () method is to clear the node; for example