JavaScript Document Object Properties

The document object provides various properties that are related to an HTML document such as title property, url property, etc.

The property is accessed by using the notation given here:


Here, objectName is the name of the object and the propertyName is the name of its property. Both are case-sensitive.

The following table lists the properties of the Document object in JavaScript.

Property Description
cookie returns a report that contains all the visible and unexpired cookies associated with the document
domain returns the domain name of the server from which the document has originated
lastModified returns the date on which the document was last modified
documentMode returns the mode used by the browser to process the document
readyState returns the loading status of the document
referrer returns the URL of all the documents referred to in an HTML document
title returns the name of the HTML document defined between the starting and ending tags of the TITLE element
URL returns the full URL of the HTML document

JavaScript Document Object Properties

Here is an example demonstrates document object properties in JavaScript:

   <title>JavaScript Document Object Properties</title>

<h3>JavaScript Document Object Properties Example</h3>
<p>The URL of this document is:<br/>
<script type="text/javascript">
<p>Loading status:<br/>
<script type="text/javascript">
<p>The title of this document is:<br/>
<script type="text/javascript">


Here is the sample output of the above JavaScript document object properties example:

javascript document object properties

JavaScript Online Test

« Previous Tutorial Next Tutorial »

Liked this article? Share it!

Like/follow us on social media for updates!