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?
update
Of course this is an old example (2010), nowadays we use $.data() and element.dataset, for setting data attributes in html5/jquery. Quite useful too.
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.