If I have some document wide event, like document.onmousedown, handled by a particular function, what is the best way to override/cancel that function it certain cases?
For example, I have document.onmousedown = somefunction(). Now, somefunction() is triggered whenever I click anywhere on the page - which is what I want. BUT - there are also certain objects on the page which have there own onmousedown event handlers. When I click these objects, both the object onmousedown event and the document onmousedown event is triggered. What is the best way to cancel the document onmousedown event when I click a certain object?