Well, I continue to nest semantic information about what the element means for the page logically in the class attribute
<li class="phone-number">555-5555</li>
This seems to work for this dual purpose — visual semantic information and a pointer to its style.
I'm not sure if this is the best idea, I'm trying to figure out if others have ways to do this.
I also started using hidden input:
<li>555-5555 <input class="semantics" type="hidden" value="phone-number" /></li>
inside the element, so with jQuery I can get additional information about the element using
li.find( '.semantics' ).val()
To get the semantics of elements from JavaScript
source share