SoFunction
Updated on 2025-03-03

Use guide for setTimeout in javascript

Use guide for setTimeout in javascript

<script>
/*
 //Method 1
 function slows(){
   alert("Popt out after 15S!");
 }
 setTimeout("slows()",5000);
 
 //Method 2
 function slows(){
   alert("Popt out after 15S!");
 }
 setTimeout(slows,5000);
 
 */

//Method 3function slows(){
  alert("Popt out after 15S!");
}
setTimeout(function(){slows()},5000);
 
</script>

The above is the entire content of this article, I hope you like it.