Pete Forde isn't a huge fan of the practical but not pure use of class="noncssmarker" and has written about Attributes > Classes: Custom DOM Attributes for Fun and Profit.
In this article Pete discusses the high level value of attributes, but then goes a lot further and he patches Prototype to make it just as easy to work with as CSS classes:
-
-
function $P(property) {
-
return document.getElementsByAttribute(property).pluck(property);
-
}
-
-
$P('subtotal') # => ["13488","9534"]
-
$P('subtotal').sum() # => 23022
-
How does this work?
Custom attributes work in all browsers that support XHTML. You do not have to define a custom DTD or sacrifice any children to use them.
We do have to make some changes to the way Prototype works, though. With the addition of a few functions to our application.js, we suddenly have the same flexibility that we had with Element.classNames.
Of course, if you go this route expect XML nazi's to moan about validation.

