Handle Div onclick function - Javascript DOM HTML Element

Javascript examples for DOM HTML Element:Div

Description

Handle Div onclick function

Demo Code

ResultView the demo in separate window

<html>
   <head> 
      <meta name="viewport" content="width=device-width, initial-scale=1"> 
      <style id="compiled-css" type="text/css">

div{//from   ww w .j a v  a  2 s .c  o  m
   width:100%;
   height:1280px;
}


      </style> 
   </head> 
   <body> 
      <script type="text/javascript">
    var getStatus = function(event){
        console.log(event);
    }

      </script> 
      <div id="target" onclick="getStatus()"></div>  
   </body>
</html>

Related Tutorials