how to create a timer which triggers an event after 30 seconds in javascript? -


i working on module in there requirement show timer shows seconds. timer must start 30 , keep on decrementing down 0; , after fire action , again start 30. how can achieve in javascript?

there go :)

var timer = 30; function decrementafter1second(){     settimeout(function(){        timer--;        if(timer==0){           dowhateveryouwantafter30seconds();           timer = 30;        }        decrementafter1second();     }, 1000); } decrementafter1second(); 

now next time want in javascript don't slacker , read language first ;) because right i'm assuming either don't know how program or don't know how use google.


Comments

Popular posts from this blog

c# - SVN Error : "svnadmin: E205000: Too many arguments" -

c# - Copy ObservableCollection to another ObservableCollection -

All overlapping substrings matching a java regex -