Is there a limit on html's data-attribute? Is it possible to have many data-attributes on a tag?
ex. data-a="" data-b="" data-c="" ... data-z=""
And also is there a limit how long the value on each data-attribute?
416.58 (64 bits)), and data-attributes seem to have a limit of 64k.
A data attribute is a custom attribute that stores information. Data attributes always start with “data-” then followed with a descriptive name of the data that is being stored. You can have multiple data attributes on an element and be used on any HTML element.
Every HTML element may have any number of custom data attributes specified, with any value.
Source: w3.org: 3.2.5.9 Embedding custom non-visible data with the data-* attributes
The limit of length has been discussed in a previous question linked by Mary Melody above: Is there a limit to the length of HTML attributes?
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