global event handler

R

Rainer Hahnekamp

Hello,

i would need some kind of global event handler that is always
triggered when the user clicks on an element within the page. The
handler should be able to gather the element which was clicked.

What strategy suits best for this issue or are there already some
existing functions?

Greetings,
 
S

scripts.contact

Hello,

i would need some kind of global event handler that is always
triggered when the user clicks on an element within the page. The
handler should be able to gather the element which was clicked.

document.onclick=
function(ev){
ev=ev||event;
var elem=ev.srcElement||ev.target
alert(elem.tagName);
}
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,995
Messages
2,570,231
Members
46,820
Latest member
GilbertoA5

Latest Threads

Top