I'm looking at using the jQuery MetaData Plugin. Looks very interesting but...
<li class="someclass {some: 'data'} anotherclass">...</li>
<script>alert($('li.someclass').metadata().some);</script>
does this code validate?
I'm looking at using the jQuery MetaData Plugin. Looks very interesting but...
<li class="someclass {some: 'data'} anotherclass">...</li>
<script>alert($('li.someclass').metadata().some);</script>
does this code validate?
Well according to the XHTML Strict DTD (and, I think, all the other relevant DTDs), the "class" attribute is CDATA, so that means just about anything goes in the value.
If you are using jQuery, just use the .data() method!
$(elem).data(key, value);
//e.g. store a string
$('#someID').data('secret','my voice is my password, verify me!');
//or store some JSON
$('#otherID').data('stuff', JSONData);