Javascript examples for DOM HTML Element:Input Button
Calling same function on pageload and on button click
<html> <head> <script> function webservice()//from w w w . j ava 2 s. c o m { for(var i=0;i<10;i++) { console.log("called"); } } window.onload=function() { webservice(); } </script> <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"> <title>Insert title here</title> </head> <body> <input id="webservice" type="button" name="webservice" value="Call Webservice" onClick="webservice()"> </body> </html>