yep ... you may add custom-attributes, and in my opinion it is the best way to do a lot of things where you have to have more then an id or name or other standard-attribs for an element. of course your may misuse other (standard) attributes ... class is a real good candidate for this ... and you may build some combined attribute-values that you use later on ... something like that:
-
// part1 ... to 3 is used later on seperately
-
<tagname ... class="part1_part2_part3"/>
-
but as the example shows, i think this will break the semantics of your code ... until you really need 3 attributes for the element you shouldn't be forced to combine them and set it as one value to an attribute, that has an other purpose.
But! there is a drawback of using custom attributes ... they make your (x)html invalid ... when checking against a DTD or XML-schema ... and may be your attributes may interfere with future versions of HTML-implementations ... so use attr-names that are not common ... Browsers don't bother about custom attributes even when the page is invalid ... it has to be wellformed ... and validity is an add-on ... and as i said ... i always would prefer the custom-attr-way instead of misusing standard-attributes
kind regards ...