Hi,
I am beginner in JavaScript. I would like to intercept all click
events on my document. I use this function for that
document.onmous edown=click;. It works well. But I would like to
continue the execution code on a other button or anything else.
Example
1) Click anywhere intercept click->Execute the code in function click().
2) Click on a link…. intercept click -> Execute the code in function
click() ->Load the link(http://test.html)
3) Click on a button… intercept click-> Execute the code in function
click() ->Execute the code for the button(submit, or other javascript)
Thank a lot for your help…
function click() {
if (event.button== 1) {
alert(“Test event”)
//execute before….ex close all div
}
//Here continue code
}