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.