If you wanted to do some stuff after time interval so here is the solution for you.
1
2
3
4
5
6
7
|
<script>
function test()
{
document.write('apple');
}
setInterval(test,2000);
</script>
|
Here setInterval() method will call test() method after each 2 seconds.