Object in inline onclick event - Javascript DOM Event

Javascript examples for DOM Event:onclick

Description

Object in inline onclick event

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 a  v  a2  s  . com*/
ShowLookup = function (bah) {
 console.log(bah.id);
}
    });

      </script> 
   </head> 
   <body> 
      <img id="xx" src="http://www.java2s.com/style/download.png" onclick="ShowLookup({&quot;id&quot;: &quot;22&quot;,&quot;name&quot;: &quot;Robert Pitt&quot;});">  
   </body>
</html>

Related Tutorials