0
how to set duration for a js function?
in js we can set time delay (after event ) for a function using setInterval setTimeout ,that repeat fxn after this much time, but how can we set the duration for a fxn i.e, do this fxn in given time. let say i have a button to change colour of a divi can set fxn delay but how can i code to change the colour in 3 sec. using js.
1 Answer
0
setTimeout(function(){
do something here
}, 3000);