Javascript Reference - HTML DOM readyState Property








The readyState property returns the loading status of the current document.

This property returns one of four values:

  • uninitialized - The document has not started being loading yet
  • loading - The document is loading.
  • interactive - The document has loaded enough and the user can interact with it
  • complete - The document is fully loaded




Syntax

document.readyState

Browser Support

readyState Yes Yes Yes Yes Yes

Example

The following code shows how to return the loading status of the current document.


<!DOCTYPE html>
<html>
<body>
<!--from   w  w w.ja va 2 s.  c  o  m-->
Loading status:
<script>
document.write(document.readyState);
</script>

</body>
</html>

The code above is rendered as follows: