Answer: With the help of setInterval static method of window object.
We can invoke or start timer.
Syntax:-
window.setInterval("javascript function",milliseconds);
For Example:-
var str = setInterval(function(){start_timer()},3000);
function start_timer()
{
alert("Hello");
}
Then it will shown Hello message in 3 seconds.
Asked In: Many Interviews |
Alert Moderator