I have a mouseDown event and a click event on the same element. When I click on it, the mouseDown event fires (i.e. alerts "Mouse pressed on P"), but the click event doesn’t. However, if I comment out the mouseDown alert statement, the click event does display its alert. Why is this? http://jsfiddle.net/A8vhq/
I have a mouseDown event and a click event on the same element. When
Share
That’s because the click never happens, when the alert box appears it interrupts the mouseup event on the element, thus interrupting mouseclick.
use
console.log('message')to test your code instead ofalert.