Well, I admit: I've extensively used jQuery.attr to store custom data in DOM elements in many, many scripts. I'm wondering if convert all my script to use jQuery.data instead of jQuery.attr. As far as I understand, the advantages of jQuery.data are:
- produce neat and valid HTML code
- can store any type of data (objects, array,...) on elements
The main advantage of custom attributes are:
- If WEB pages are not strict HTML, I can produce HTML code with custom attributes on the server
- In firebug it's easy to inspect my HTML code in search of my custom attributes
Can someone tell me if I miss something or if exists issues that makes use of jQuery.data highly preferable?