+ 2
Hi guys am kinda new to JavaScript please how do i set timeout using function
Javascript
3 odpowiedzi
+ 3
setTimeout(myFunc, 1000);
function myFunc(){
alert(“A second has gone by”)
}
The basic idea is that it take 2 parameters. It takes a function, then how many milliseconds until that function is called (1000 milliseconds per second)
+ 3
As Jax said, or you can do this way too:
setTimeout(function(){
//your js
},1000)
- 2
dio cane!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!