So many times writing html code along with javascript, I create <a> elements.
My question is, can I ignore the href attribute? as I rather add an ID attribute and handle the click there.
Most of the time when I do that, its not to go to a different page, but more to perform a ajax call of some sort.
I hate having the # in the url, it just looks ugly.
Should I rather use a different element, i.e. a <span> and just modify it with a class to look like link?
Thanx
J
If you have a link without a
href, it’s not a link, it’s probably a button, and you should be using one, instead of a link.Button VS. Link – User Experience.SE