Javascript examples for DOM Event:click
Button to fire the click event automatically
<html> <head> <script type="text/javascript"> function haha1()//from w ww . ja v a 2 s. com { console.log('haha1'); } </script> <script> window.onload = function(){ document.getElementById('haha').onclick = function(){ haha1(); }; document.getElementById('haha').click(); } </script> </head> <body> <input type="button" id="haha" value="lol"> </body> </html>