In order to run a function automatically after waiting for some time, we are using the jQuery delay() method.
The .delay() method in jQuery which is used to set a timer to delay the execution of the next item in the queue.
- When the Button is clicked the process is delayed to the specific time period using .delay() method.
- Functions or process is queued using .queue() method.
After the process or functions are excuted, all excuted functions are dequeued using .dequeue() method.
Example 2: Along with alert method
- How to scroll automatically to the Bottom of the Page using jQuery?
- How to scroll automatically to a particular element using JQuery?
- How to call functions after previous function is completed in jQuery ?
- How to Automatically Close Alerts using Twitter Bootstrap ?
- How to get focused a button automatically when the page load using HTML ?
- How to check a selector matches some content using jQuery?
- How to select all elements that contains some specific CSS property using jQuery ?
- How to use Bootstrap modal for YouTube videos and play automatically ?
- How to automatically close all collapsible elements inside of the accordion when closing the accordion?
- How to automatically start a download in PHP ?
- How to make a call-able link using HTML ?
If you like GeeksforGeeks and would like to contribute, you can also write an article using contribute.geeksforgeeks.org or mail your article to email@example.com. See your article appearing on the GeeksforGeeks main page and help other Geeks.
Please Improve this article if you find anything incorrect by clicking on the "Improve Article" button below.