Javascript examples for DOM Event:target
Get event.target from event handler
<html> <head> <meta name="viewport" content="width=device-width, initial-scale=1"> </head> <body> <div id="a" onclick="doSomething(event);"> div "a" <div id="b"> div "b" </div> <div id="c"> div "c" </div> </div> <script type="text/javascript"> function doSomething(e) {/*from www .j a v a 2s .c o m*/ if (e.target.id !== "b") { console.log(e.target.id); } } </script> </body> </html>