Answer the question
In order to leave comments, you need to log in
What is the danger of using arbitrary attributes (not data-)?
I've been thinking - is it really necessary to use data-attributes?
For example, my library needs attributes. Logically, they should be given names like data-libname-attrname="value". The libname part plays the role of a namespace, attrname is the name of the attribute itself. There seem to be no problems here, but it's long - it's boring then to write this same data dozens of times in the html code. Why not just write libname-attrname="value"?
What threatens me with my own names? Well, besides the fact that it is generally accepted, valid and other semantic blah blah. Well, they use all sorts of Angulars, why am I worse?
Answer the question
In order to leave comments, you need to log in
They do not threaten anything if they do not come into conflict with the existing ones.
It's ugly, misleading and doesn't meet accepted standards - reason enough to stop it. Also, data is part of the specification, which means it's valid, unlike all other custom attribute options. Validation with elements that are not in the spec will never pass.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question