Javascript examples for DOM Event:onclick
Send the clicked object as parameter in onClick function
<html> <head> <meta name="viewport" content="width=device-width, initial-scale=1"> <script type="text/javascript"> window.onload=function(){//w ww .j av a2 s .c o m clickCircle=function(element) { console.log(element) console.log(element.tagName) } } </script> </head> <body> <li class="circle" onclick="clickCircle(this)"></li> </body> </html>