Favorites

DOM Document.readyState Property

☕
Enjoying this site?

Help keep it running with a small coffee donation. Every bit of support is appreciated!

Buy us a coffee
Document.readyState
DOM Document PropertyThis property is supported by all modern browsers.
Updated 28th November 2026

The readyState property tells you how far the page has loaded: loading, interactive or complete.

Description

The read-only readyState property describes the loading state of the document. It's "loading" while HTML is being parsed, "interactive" once the DOM is ready (just before DOMContentLoaded), and "complete" once images, styles and other resources have loaded (just before the window's load event). The readystatechange event fires when it changes.

Checking it lets a script run its set-up code straight away if the page is already ready, or wait for the event if not.

You can also listen for the readystatechange event on the document to react to each change, although DOMContentLoaded and the window's load event cover most needs. In a script with defer or type="module", readyState is already "interactive" when it runs.

Syntax

document.readyState

Value

"loading" while the page is being parsed, "interactive" once parsing is done, and "complete" when everything has loaded.

Example

function ready(fn) {
  if (document.readyState !== 'loading') fn();
  else document.addEventListener('DOMContentLoaded', fn);
}
ready(() => console.log('DOM ready, state:', document.readyState));

Browser Support

The following information will show you the current browser support for the Document.readyState property. Hover over a browser icon to see the version that first introduced support for this property.

This property is supported by all modern browsers.

Desktop

Chrome
Edge
Firefox
Opera
Safari

Tablets & Mobile

Chrome Android
Firefox Android
Opera Android
Safari iOS
Samsung Internet
Android WebView
-
Supported Unknown Not supported
☕
Enjoying this site?

Help keep it running with a small coffee donation. Every bit of support is appreciated!

Buy us a coffee