html - Custom data in XHTML 1.0 Strict -


i use custom attributes in html, jquery stuff. saw there data-xyz attributes in html5, need xhtml 1.0 strict. other options have?

you can use jquery metadata plugin allows write data in class attribute in json format:

<li class="someclass {some: 'data'} anotherclass">...</li> 

then in jquery, @ data:

var data = $('li.someclass').metadata(); if ( data.some && data.some == 'data' )     alert('it worked!'); 

this should meet requirements of being xhtml 1.0 strict, , allows use plug-and-play solution :)


Comments

Popular posts from this blog

android - Spacing between the stars of a rating bar? -

html - Instapaper-like algorithm -

c# - How to execute a particular part of code asynchronously in a class -