Send the clicked object as parameter in onClick function - Javascript DOM Event

Javascript examples for DOM Event:onclick

Description

Send the clicked object as parameter in onClick function

Demo Code

ResultView the demo in separate window

<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>

Related Tutorials