I’ve been reading up on custom data attributes for html webpages (one example of the numerous ones). From what I can tell going forward this is likely the best solution.
<div data-my_attrib="stackoverflow"></div>
My question pertains to backwards compatibility.
Supposedly the html standard specifies that unknown attributes should be ignored (I’ve read this comment multiple times, haven’t actually read the standard myself :P), but are there any known browsers (including past versions, both mobile and PC-based) which might have problems with the new custom attribute specification? If so, which ones?
Additionally, are there any known possible issues where data-something might already be defined for old browsers (something is an arbitrary placeholder)? The focus is on core browser functionality (including standard addons shipped with the browser), ignore website scripts/libraries like JQuery and the likes.
Unknown attributes are ignored in that they don’t do anything, but they are still available for
getAttributeto retrieve.I’m fairly sure it’s safe to assume that
data-*is not used for anything else – otherwise they would have chosen a different identifying keyword that didn’t conflict with something else.