Should I leave href empty when implementing click events via jQuery?
- by dreza
Is it preferable to have # in a link's href attribute when I am implementing the click event via jQuery, or is it ok to leave href empty?
i.e.
<a id="myLink" href="#" />
vs
<a id="myLink" href="" />
When I'm doing
$("#myLink").on('click', function() {
// do ajaxy stuff
});
Although I understand the click event could be on a span or other such element I'm interested in this case for particular best practices when using an a tag.