4 ms·
HTML5 data attributes, how to use them and why
- MatthewPhillips 14y agoThis is nice and all, but I've yet to find a reason to use data attributes rather than just storing the same data in a js variable. I'd love to be enlightened.
- mite-mitreski 14y agoWhen you store the data in the js variable it does not have the semantic link with the HTML element that describes something. The idea here is build up your markup to be as meaningful as possible