In an HTML <label> tag, say there are some custom attributes in the tag and one or more of them alphabetically come before the for attribute. Should the for attribute come first for good style/readability, or does this not matter?
In an HTML <label> tag, say there are some custom attributes in the tag
Share
The order of the HTML attributes is irrelevant.
You can try and be consistent for readability, but the DOM parser does not care and once parsed, they do not have any specific order (though in practice they may appear in the order they were assigned).
Personally I would place the
forattribute first as other developers looking at your HTML will look for it (and want to see it first).