fire "onload" event on document and from onclick event - Javascript DOM Event

Javascript examples for DOM Event:onclick

Description

fire "onload" event on document and from onclick event

Demo Code

ResultView the demo in separate window

<html>
   <head> 
      <title>Test by Josh</title> 
      <script type="text/javascript">
      window.onload = function() {
        console.log("Test");
      }/*from   w  ww .  j a  v a  2 s .com*/
    
      </script> 
   </head> 
   <body> 
      <h1 onclick="window.onloadfix()">Test</h1> 
      <script type="text/javascript">
      window.onloadfix = function() {
        window.onload();
      }
    
      </script>  
   </body>
</html>

Related Tutorials