DOM Properties
Document.readyState
Reports loading while parsing, interactive after parsing, and complete after the document and relevant subresources load. Use DOMContentLoaded or readystatechange according to the dependency. Example result: loading.
Formal Syntax & Structure
html syntaxhtml
document.readyStateReturn Value
string
Current document value.
Working Example
Example Snippethtml
<p> Result: <output id="result"></output></p><script> const result = document.getElementById("result"); (async () => { result.textContent = document.readyState; })().catch(error => { result.textContent = "Error: " + error.name; });</script>