SetTimeout and call a function - Javascript Browser Object Model

Javascript examples for Browser Object Model:Window setTimeout

Description

SetTimeout and call a function

Demo Code

ResultView the demo in separate window

<html>
   <head> 
      <title>Wake up call</title> 
      <script type="text/javascript">
        function wakeUpCall() { // Function is defined here
            setTimeout('aa("ok");', 5000);
        }//w w  w. ja  v a 2  s  .c  o m
        function aa(bb) {
            console.log(bb);
        }
    
      </script> 
   </head> 
   <body bgcolor="lightblue"> 
      <form> 
         <input type="button" value="Wake me" onclick="wakeUpCall()"> 
      </form>  
   </body>
</html>

Related Tutorials