An attribute in HTML is an XML attribute of an HTML element
Attribute names are case-insensitive.
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 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
See What are Boolean Attribute in HTML ?
See Attribute manipulation with DOM
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.