Search
 
SCRIPT & CODE EXAMPLE
 

JAVASCRIPT

javascript run something after x seconds

setTimeout(function(){
  location.reload();
}, 3000); //run this after 3 seconds
Comment

how to let a function execute after 5 seconds javascript

setTimeout(function() {
           //whatever you want to execute
           }, amountOfSeconds * 1000); //executes after amountOfSeconds seconds

//with defined function
setTimout(functionName, amountOfSeconds * 1000);

//example
setTimeout(function() {
           console.log("It has been 3 seconds.");
           }, 3000);
Comment

call function after 2 seconds javascript


  setTimeout(
    function() {
      document.getElementById('div1').style.display='none';
      document.getElementById('div2').style.display='none';
    }, 5000);
Comment

PREVIOUS NEXT
Code Example
Javascript :: text to speech using javascript 
Javascript :: how to find factorial of a number in javascript 
Javascript :: verify radio checked jquery 
Javascript :: Copy document DOM without reference 
Javascript :: jquery select option auto select 
Javascript :: nodejs server fetch is not defined 
Javascript :: node print stdin 
Javascript :: validate aadhaar number in javascript 
Javascript :: upload file using ajax 
Javascript :: how to check nan in jquery 
Javascript :: regx get only domain name from url 
Javascript :: TypeError: date.getHours is not a function 
Javascript :: Bootstrap modal hide and show 
Javascript :: javascript alerter 
Javascript :: javascript change class of item 
Javascript :: dom get all tags 
Javascript :: pdf.js cdn 
Javascript :: get unique values from array of objects javascript 
Javascript :: delete empty values from object js 
Javascript :: Only numbers or string. Input field in React 
Javascript :: golang convert json string to map 
Javascript :: afficher un div qui etait cache en javascript 
Javascript :: styled components error in nextjs 
Javascript :: jquery prop checked 
Javascript :: javascript max length with elipsis 
Javascript :: nodefetch of ES modules is not supported. 
Javascript :: ctx linecap 
Javascript :: moment calculate duration 
Javascript :: javascript array to comma separated list 
Javascript :: javascript getelementbyid disable 
ADD CONTENT
Topic
Content
Source link
Name
7+9 =