The
mousedown
and
click
events occur together and are not sharing the same event object.
Calling
e.preventDefault();
in the
mousedown
event is not able to prevent the default click behaviour on the click event.
Why it works for you in Chrome is most likely a different reason or a even false positive.
To Demonstrate, assuming you have the following HTML:
<a href="http://jsfiddle.net/" id="whichkey">link to google</a>
<div id="log"></div>
The following Script will not prevent the default behaviour and clicking the link will always work:
$("#whichkey").on("mousedown", function (event) {
$("#log").html(event.type + ": " + event.which);
event.preventDefault();
});
However, if you add the following script to the above, then it will work.
$("#whichkey").on("click", function (event) {
event.preventDefault();
});
See this
jsFiddle to demonstrate and for you to play around with: