sometimes i store values in the element’s atributes for using in javascript.
ex: <div class="open_popup" target="first_popup">click here</div>.
also, some javascript plugins that i use put elements in the page with the atribute generated="true".
it is a very useful technique for me but it is not compliant with the strict versions of xhtml.
what problems should it cause?
should i worry about that?
if i should, what’s the solution?
thanks (:
I would use the jQuery.data method:
The problems with your method, at least the way I see it, is that it is not valid xhtml. And why would that matter? Basically, you don’t know exactly how a browser would handle your invalid attributes – it might just strip them off the dom node or something else completely.