Javascript examples for DOM Event:onclick
Handle Onclick and page load event both
<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>