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 call functions after previous function is completed in jQuery ?
- How to scroll automatically to a particular element using JQuery?
- How to scroll automatically to the Bottom of the Page using jQuery?
- How to call PHP function on the click of a Button ?
- How to call PHP function from string stored in a Variable
- How to use Bootstrap modal for YouTube videos and play automatically ?
- How to define jQuery function ?
- PHP | time() Function
- How to disable a button in jQuery dialog from a function ?
- Print PHP Call Stack
If you like GeeksforGeeks and would like to contribute, you can also write an article using contribute.geeksforgeeks.org or mail your article to firstname.lastname@example.org. 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.