About
An attribute in HTML is an XML attribute of an HTML element
Property
Name
Attribute names are case-insensitive.
Special
Classes and IDs are attributes used in the selection of element. Class and ID names cannot begin with numerals; they must begin with alphabetic characters.
Order
Order does not matter but some attributes are more searched (ie have more functionality) while reading HTML.
The code guide gives the following order that reflects this idea
- src, for, type, href, value
- title, alt
Without any value
How to access HTML Attribute via Javascript
How to track the modification of values?
See How to use MutationObserver to track mutation on the DOM ?
Note on Body attributes modifications: If a document has two body elements, it's possible that the browser will overwrite the attributes of the first body element with the attributes of the second.