Get the event name and type from its calling - Javascript DOM Event

Javascript examples for DOM Event:type

Description

Get the event name and type from its calling

Demo Code

ResultView the demo in separate window

<html>
   <head> 
      <meta name="viewport" content="width=device-width, initial-scale=1"> 
      <script type="text/javascript">
function func(event,ctrl)/*  www .j  a v a2  s . c  o  m*/
{
   console.log(event.type);
}

      </script> 
   </head> 
   <body> 
      <div onclick="javascript:func(event,this)" onmouseover="javascript:func(event,this)"> 
         <span>Hi</span> 
      </div>  
   </body>
</html>

Related Tutorials