how to time out function after 10 seconds code example
Example 1: javascript run something after x seconds
setTimeout(function(){
location.reload();
}, 3000); //run this after 3 seconds
Example 2: javascript settimeout
// Redirect to index page after 5 sec
setTimeout(function(){ window.location="index"; },5000);