Possible Duplicate:
Is it considered bad practice to use non-standard HTML attributes?
Hi folks,
I'm building a javascript library, the idea of which is to add functionality to various elements on page.
Easiest way for complete isolation would be to add a non standard attribute
e.g. <div special="true" >...</div>
Other alternatives are classes and onclick javascript.
Any ideas?
HTML5 supports "data" type attributes, but in general for a modern day site, this would cause most sites to fail validation if they are going for any doctype other than HTML5.
So that would just be adding a barrier to entry for potential users of your library.
Don't do it. I've learned the hard way that this is not cross-browser. I had a jQuery-intensive app totally fail to function in Chrome because of this.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With