The default action you are preventing on the mouseup
event is not responsible for changing the href. That being said, it doesn't matter if you prevent it or not, the href gets executed on the click
event.
The click
event gets fired after mousedown
, so changing the mouseup
to click
should work just fine.