Javascript examples for Statement:for
Applying delay between iterations for loop
<html> <head> <meta name="viewport" content="width=device-width, initial-scale=1"> <script type="text/javascript"> window.onload=( function() {//from w ww . jav a 2 s . c o m for(i = 1; i <= 3; i++){ (function(i){ setTimeout(function(){ console.log(i); }, 1000 * i); }(i)); } }); </script> </head> <body> </body> </html>