2.1.13 [HTML5:2014] Section 3.2.5.9 Embedding custom non-visible data with the data-* attributes
V0022: A data- attribute that contains an uppercase letter after a dash does not insert a dash before the character
The specification states:
-
3.2.5.9 Embedding custom non-visible data with the data-* attributes ... The algorithm for setting names to certain values ... 4. For each uppercase ASCII letter in name, insert a U+002D HYPHEN-MINUS character (-) before the character and replace the character with the same character converted to ASCII lowercase.
All document modes (All versions)
A data-
attribute that
contains an uppercase letter after a dash does not insert a dash before the
character.
V0023: A SyntaxError is not thrown when setting a data- attribute that contains a dash in the name
The specification states:
-
3.2.5.9 Embedding custom non-visible data with the data-* attributes ... The algorithm for setting names to certain values ... 3. If name contains a "-" (U+002D) character followed by a lowercase ASCII letter, throw a SyntaxError exception and abort these steps.
All document modes (All versions)
A SyntaxError
is not thrown
when setting a data-
attribute that contains a
dash in the name (e.g. data-to-string).