The attributes property in HTML DOM returns the group of node attributes specified by NamedNodeMap objects. The NamedNodeMap object represents the collection of attribute objects and can be accessed by index number. The index number starts at 0.
Return Value: It returns the NamedNodeMap object which is the collection of nodes.
Note: In Internet Explorer 8 and earlier versions, the attributes property will return a collection of all possible attributes for an element that can result in higher value than expected.
Supported browsers The browser supported by DOM attributes property are listed below:
- Google Chrome
- Internet Explorer
- Apple Safari
- SVG Element.attributes Property
- HTML | Attributes
- HTML | Id Attributes
- HTML | data-* Attributes
- HTML | Attributes Complete Reference
- Difference between 'hidden' and 'aria-hidden' attributes in HTML
- Tags vs Elements vs Attributes in HTML
- Why are dashes preferred for CSS selectors / HTML attributes ?
- What is the difference between properties and attributes in HTML?
- jQuery | Set Content and Attributes
- jQuery | Get Content and Attributes
- XML | Attributes
- PHP | SimpleXMLElement attributes() Function
- Data-toggle attributes in Twitter Bootstrap
- Perl - Attributes in Object Oriented Programming
- What are these attributes `aria-labelledby` and `aria-hidden` ?
- How to filter object array based on attributes?
- HTML | DOM lang Property
If you like GeeksforGeeks and would like to contribute, you can also write an article using contribute.geeksforgeeks.org or mail your article to firstname.lastname@example.org. See your article appearing on the GeeksforGeeks main page and help other Geeks.
Please Improve this article if you find anything incorrect by clicking on the "Improve Article" button below.