Home > Article > Web Front-end > Sharing examples of common js attributes
This article mainly shares with you examples of common js attributes. First, there are a few common attributes. I hope it can help everyone.
##12345678910 1112
13 14 15 16 17 18 19 20 21 22 23 24 25 26 |
$( this ).css( "color" , "green" );
|
Insertion method:
#1234567 891011
12 |
|
Removal method
# #123 |
|
remove() - Remove the selected element (and its child elements)
empty() - Remove the child element from the selected element and clear the
Parent attribute
#123 |
parent() The direct parent element of the selected element parents() All ancestor elements of the selected element, all the way up to the root element of the document () parentsUntil() between the two given elements All ancestor elements of |
## 123 |
All elements that are descendants |
Sibling attributes
## 12345678 910 |
## nextUntil()
|
Traversal filtering
## 12345678 910 |
|
Related recommendations:
What are the commonly used attributes for dividing frames and windows in HTML
The above is the detailed content of Sharing examples of common js attributes. For more information, please follow other related articles on the PHP Chinese website!