I would like to add some metadata to my list elements so they look something like this:
<ul>
<li summary="A White Drink">Milk</li>
<li summary="A tiny White football">Eggs</li>
<li summary="A Cube of gooey sliminess">Butter</li>
</ul>
What property do I use? I don’t want to make one up, and I don’t want to use the title property because the metadata would then display in the browsers tooltip.
Do you need to do this in the HTML proper? I think metadata is best stored in the DOM. If you are using jQuery, try
.data(): http://api.jquery.com/jQuery.data/The best solution for HTML proper is, IMHO, to use a custom data attribute. From the HTML5 spec: “Every HTML element may have any number of custom data attributes specified, with any value.”
Custom data attributes are specified at http://www.w3.org/TR/html5/elements.html#custom-data-attribute.