Parrots's answer is best for this specific case: if you are using a link, the href should point to somewhere useful for non-JavaScript users and for people who open the link using middle-click, or right-click-bookmark or whatever.
If you don't have a destination for a link, you shouldn't really be using a link. You could use a span like SO does (although this needs some tabindex and script help if you want to make it properly keyboard-responsive) or, generally best (if you don't mind the extra pixel of padding and movement in IE), a restyled button.
However in the general case you do sometimes need to include additional data that doesn't fit in an existing attribute like href. Sometimes that can be in the id, but then you're a little limited with the characters you use. For example your code is invalid HTML because ids can't start with a number. For numeric ids you can try id="foo-28" and extract the number from code.
Or, you could start putting multiple parameters in class names (class="foo-28 bar-16a") and using a JS function to split, match the named prefix and return the rest. Most characters are allowed in a class name, but of course you couldn't use another space. (You could also encode it in some way in the className, eg. URL-encode.)
Or, you could put a comment inside the element and use DOM methods to get the comment object and extract its data. You might put JavaScript/JSON inside it, eg.:
<span class="do-something"><!-- {foo: 28, bar: '16a'} --> Something </a>
Or, you might use HTML5 data- attributes. Or (...several other options...)