I’m writing a chess program with JQuery and I want to keep track of the chess squares (TD’s in a table). I figured I would attach metadata to the square TDs.
What is a good standard to follow when attaching metadata to a table element?
custom attributes?
adding classes?
With jQuery, you can use the .data() method, as it was already pointed out in the comment.
In general, however, metadata attributes in the DOM should have a name starting with
:data-
See the w3c spec on custom data attributes.