Menu Close

jQuery Chaining Method


Here, we can use multiple jquery methods together on a single element. It’s named as a chaining method and it is the big advantage of the jQuery framework. So the binding methods make the code short. Also, the browsers do not have to find the same elements more than once.


<!DOCTYPE html>
    <script src=""></script>
        <button id="colors">Click me</button>
        <p id="chain">Chaining method in jQuery</p>  
    <script type="text/javascript">
        $(document).ready(function() {
            $("#colors").click(function() {                               
                $("#chain").css("color", "orange")
Posted in HTML, jQuery

You can also read...