data-attributes is there a limit of length and how many?
Asked Answered
I

2

7

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?

Ishtar answered 11/9, 2014 at 16:42 Comment(2)
similar question - #1496596Ligate
Possible duplicate of Is there a limit to the length of HTML attributes?Remedial
L
5

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?

Landsknecht answered 12/11, 2014 at 23:50 Comment(0)
H
0

Far of my concern. Their is no max length when defining data attribute in JavaScript just remember to always use lowercase [-variable]

Hartwell answered 16/5, 2017 at 16:33 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.