Skip to content
Related Articles

Related Articles

jQuery | ready() with Examples

View Discussion
Improve Article
Save Article
Like Article
  • Last Updated : 26 Sep, 2018

The ready() method is an inbuilt method in jQuery which helps to load the whole page then execute the rest code. This method specify the function to execute when the DOM is fully loaded.



Parameters: This method accepts single parameter function which is mandatory. It is used to specify the function to run after the document is loaded.

Return Value: This method returns the document after performing the ready() method.
Below example illustrates the ready() method in jQuery:


<!DOCTYpe html>
        <title>The ready Method</title>
        <script src=
        <!-- jQuery code to show the working of this method -->
                     $("p").css("color", "green");
                     $("p").css("font-size", "40px");
         div {
             width: 60%;
             min-height: 100px;
             padding: 10px;
             border: 2px solid green;
         <p>Welcome to</p>
         <!-- click on this button -->
         <button>Click Here!</button>

ready method

My Personal Notes arrow_drop_up
Recommended Articles
Page :

Start Your Coding Journey Now!