Sublime Text
<!DOCTYPE html> <html> <body> <button type="button" onclick="rePlay()">Click here</button> <p id="demo"></p> <script> var x = 1; function rePlay(){ for(var i = 1; i <= 10; i++){ setTimeout(abc, 1000*i); } } function abc(){ document.getElementById("demo").innerHTML = x++; } </script> </body> </html>
<!DOCTYPE html> <html> <body> <button type="button" onclick="rePlay()">Click here</button> <p id="demo"></p> <script> var x = 1; function rePlay(){ for(var i = 1; i <= 10; i++){ setTimeout(abc, 1000*i); } } function abc(){ document.getElementById("demo").innerHTML = x++; } </script> </body> </html>