4 ms·
May I ask: if it's intended to be used with HTML language, why not use legal HTML syntax? (Custom author-defined tag names, custom attributes for those custom t
by err4nt 3y ago
May I ask: if it's intended to be used with HTML language, why not use legal HTML syntax? (Custom author-defined tag names, custom attributes for those custom tags, and data-* attributes on any element are all legal ways to extend HTML with new attributes)
- recursivedoubts 3y agoyou can use a data attribute if you want, data-script="on click log 'yay'" i don't have strong opinions on that, i've been told by people who work on the browsers that, from a practical perspective, custom non-data attributes are supported and always will be, and the underscore attribute is a tribute to underscore.js, a library I always liked.
- err4nt 3y agoSome thoughts: Browser developers today can't speak for the way browser makers in the future may build standards-based browsers. Standards provide a level of future-proofing. Also browsers are not the only tools developers will use to interact with HTML. And most importantly, the custom extensibility built-in to the HTML language is supported by all browsers as well.
- recursivedoubts 3y agoyep i get it, you can use data attributes if you want, but i've been told by high ups on both the chrome team and the edge team that it doesn't matter i am not ideological about it