You are here: Reference > JavaScript > client-side > HTML DOM > properties > readyState (document, a, abbr, ...)

readyState property (document, a, abbr, ...)

Browser support:
Returns a string value that represents the state of the object.
Use this property together with the onreadystatechange event to be notified when the state changes.
Note that in Firefox, Opera, Google Chrome and Safari, the readyState property is not supported by HTML elements (except by the script element in Opera), only the document object supports it (in Firefox from version 3.6).


You can find the related objects in the Supported by objects section below.
This property is read-only.

Possible values:

String that represents the state of the object.
One of the following values:
Initialization is ready.
A part of the data is available.
The data of the object has been loaded.
The data of the object is currently loading.
Object is not initialized.
Default: this property has no default value.

Example HTML code 1:

This example illustrates the use of the readyState property:
    <script type="text/javascript">
        alert ("readyState: " + document.readyState);
        function Init () {
            alert ("readyState: " + document.readyState);
<body onload="Init ()">
Did you find this example helpful? yes no

Supported by objects:

Related pages:

External links:

User Contributed Comments

Post Content

Post Content