js run a function after few seconds code example
Example 1: javascript run something after x seconds
setTimeout(function(){
location.reload();
}, 3000); //run this after 3 seconds
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);
}