Another nice solution is jQuery's metadata plugin. It is especially useful if you need more than just 1 piece of data.
I suspect this will be part of jQuery core before long since jQuery already supports attaching data to DOM elements using $.data() method.
Joined: Jul 09, 2007
I will frequently use HTML5-style custom attributes to capture such data easly
I dont know much about HTML 5 attributes, but I googled and found john resig blog. This brings me to my next question though, I havent tested this but will this work with IE6?
I am afraid that I dont have the freedom to select my targeted browser and I need to support this.