wait javascript 1 second code example
Example 1: javascript wait 1 second
setTimeout(() => {console.log('1 second finished!')}, 1000);
Example 2: run js function after some sec
function myClick() {
setTimeout(
function() {
document.getElementById('div1').style.display='none';
document.getElementById('div2').style.display='none';
}, 5000);
}