run event in 5 seconds javascript code example Example: javascript settimeout setTimeout(function(){ alert("Sup!"); }, 2000);//wait 2 seconds