setTimeout(function() { // Do something after 3 seconds // This can be direct code, or call to some other function $('#alert').hide(); }, 3000);