2 ms·
What innovations were possible with the "data-" attributes? As far as I know, they just provide a standardized way of naming custom attributes. I've been using
by statictype 14y ago
What innovations were possible with the "data-" attributes? As far as I know, they just provide a standardized way of naming custom attributes. I've been using custom attributes in html tags for unobtrusive javascript before I knew the data- attributes existed.
Do they provide any extra functionality as such (like a faster/optimized querying api) ? Or is it just a promise that attributes beginning with "data-" will never be used as part of the HTML standard?
- masklinn 14y ago> Or is it just a promise that attributes beginning with "data-" will never be used as part of the HTML standard? Just that. Some libraries do build upon that though, e.g. in jQuery, $el.data('key') will fall back on the @data-key attribute if it does not find the key in its internal store.