Javascript examples for Browser Object Model:Window setTimeout
SetTimeout and call a function
<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>