I know that the value of identifiers can't begin with numbers or hyphens, but can data attributes? And if so is there any reason for not using data--=""
(not that I would, just curiosity speaking)
See the definition
A custom data attribute is an attribute in no namespace whose name starts with the string "data-", has at least one character after the hyphen, is XML-compatible, and contains no characters in the range U+0041 to U+005A (LATIN CAPITAL LETTER A to LATIN CAPITAL LETTER Z).
The reason is XML compability. And of course javascript compability because var 1234
is not possible.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With