jQuery Reference Manual - Attribute Operations
- Previous Page jQuery Document Operations
- Next Page jQuery CSS Operations
jQuery Attribute Operation Methods
The following methods listed below obtain or set the DOM attributes of the elements.
These methods are applicable to both XML documents and HTML documents, except for: html().
Method | Description |
---|---|
addClass() | Add specified class names to the matched elements. |
attr() | Set or return the attributes and values of the matched elements. |
hasClass() | Check if the matched elements have the specified class. |
html() | Set or return the HTML content of the matched element collection. |
removeAttr() | Remove specified attributes from all matched elements. |
removeClass() | Remove all or specified classes from all matched elements. |
toggleClass() | Add or remove a class from the matched elements. |
val() | Set or return the value of the matched elements. |
Note:jQuery Document Operations Reference ManualAlso lists the above methods. The purpose of this reference page is to facilitate users in individually consulting methods related to attribute operations.
- Previous Page jQuery Document Operations
- Next Page jQuery CSS Operations