Javascript examples for Browser Object Model:Window setInterval
Test setTimeout function
<html> <head> <meta name="viewport" content="width=device-width, initial-scale=1"> <script type="text/javascript" src="https://code.jquery.com/jquery-1.8.3.js"></script> <script type="text/javascript"> $(window).load(function(){//from w w w . j ava 2 s. c om var yes=0; setInterval(function () { console.log(yes); yes++; }, 1000); }); </script> </head> <body> </body> </html>