How to Redirect to Another Page After 5 Seconds using jQuery ?
In this article, we will learn, how to redirect to another page or URL after a specified time in jQuery. The built-in function used for performing the action is as follows. The setTimeout(callback, delay) function takes two parameters a callback and a time in milliseconds. When this method is called, the callback function will be executed after the specified time. With this method, the callback function is executed only one time after the specified time.
Our goal is to redirect to another page after 5 seconds and this will happen only one time. We use jQuery setTimeout() function
Output: After 5 seconds, the “geeksforgeeks” home page will open.