I want to create a alert \"Hello\" which will show up after 10sec. I used setTimeout and it working fine. Now i would like to do counter(timer) which will show 10, 9, 8,7 ...
The setInterval() method calls a function or evaluates an expression at specified intervals (in milliseconds).
setInterval()
you can stop evaluates by clearTimeout() function.
evaluates
clearTimeout()
Try the code
}, 1000)