Handle Onclick and page load event both - Javascript DOM Event

Javascript examples for DOM Event:onclick

Description

Handle Onclick and page load event both

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 calculate (var1, var2, var3) {
 console.log(var1+","+var2+","+var3);
}

      </script> 
   </head> 
   <body onload="calculate('Body1','Body2',200)">  
      <div> 
         <input type="button" value="calculate" onclick="calculate('Input Object1','label1',200)"> 
      </div>   
   </body>// ww w  .  j a  v  a2 s  .c  o m
</html>

Related Tutorials