Which browsers (and versions) do not support custom attributes?
I want to add some custom attributes to my tags and I would like to know which browsers will not handle this properly.
HTML:
<div id="mydiv" mycustomattribute="I've got one.">Test</div>
JavaScript:
alert(document.getElementById("mydiv").getAttribute("mycustomattribute"));
First, use the
data-*for custom attributes. That will be HTML5 compatible. Secondly, all browsers currently support it while usinggetAttribute()