Javascript examples for DOM Event:target
Get window.event.target
<html> <head></head> <body> <input value="click" type="button" onclick="grabId(event)"> <script> function grabId(event) {/* ww w . j ava2 s .c o m*/ var targ; if (!e) var e = event; if (e.target) targ = e.target; else if (e.srcElement) targ = e.srcElement; if (targ.nodeType == 3) // defeat Safari bug targ = targ.parentNode; } </script> </body> </html>