jQuery delay() with Examples

The delay() method in jQuery is used to set a delay to delay the execution of the next item in the queue.


The syntax is as follows −


Above, the parameter speed is the speed of delay, whereas the queue is the name of the queue.

Let us now see an example to implement the jQuery delay() method 


 Live Demo

<!DOCTYPE html>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.4.1/jquery.min.js"></script>
.demo1 {
.demo2 {
   width: 300px;
<div class="demo1"></div><br>
<div class="demo2"></div><br>


This will produce the following output -

After clicking the Fade button, animation appears slowly since we have set delay -