I have an XHTML page where each HTML element has a unique custom attribute, like this:
If you're willing to use JQuery, then:
var myElement = $('div[tokenid="14"]').get();