How to use Event Ready() Method in JQuery

In this article I am going to explain about event ready() method in jquery.
  • 1834

jQuery Event Ready() Method

jquery event ready occurs when document is successfully loaded and specifies document is ready for use. Its also specifies what done at the time of when event is occurs. Ready() method only use with current document.

Syntax

$(document).ready(function)

Example

Ready() function is must for using jquery.

<html>

<head>

    <script type="text/javascript" src="jquery.js"></script>

    <script type="text/javascript">

        $(document).ready(function () {

            $("button").click(function () {

                $("div").hide();

            });

        });

    </script>

</head>

<body>

    <div style="background-color: Blue; height: 100px; width: 100px">

    </div>

    <button>

        click me</button>

</body>

</html>

Output

ready.jpg

You may also want to read these related articles: here
 
Ask Your Question 
 
Got a programming related question? You may want to post your question here
 

Categories

More Articles

© 2019 DotNetHeaven. All rights reserved.