In any object oriented programming, we can call the behaviors by using the object. Similarly in JQuery we can call the JQuery functions using JQuery Method Chaining.

JQuery Method Chaining :

Usually if we want to execute a set of statements, we should write each statement separately and those are executed line by line.  Instead of separating every statement as an individual line, in Jquery we can combine all statements as a single statement. This mechanism is called as JQuery method chaining.

$("#p1").css("color", "green").slideUp(2000);

On the above example, initially JQuery gets the element which is having p1 as id and add color to it and then apply the slideUp effect on it. This process is called JQuery chaining.

JQuery Method Chaining Example :


<!doctype html>
<html lang="en">
<meta charset="utf-8">
<title>JQuery Method Chaining demo</title>
p {
    width: 400px;
<script src=""></script>

        Just abserve carefully, new we are going to <i>slide up</i> this

        $("button").click(function() {
            $("p").css("color", "#027d3a").slideUp("5000");


Happy Learning 🙂