You are here: Reference > JavaScript > client-side > HTML DOM > properties > content (window)

content property (window)

Browser support:
Returns a reference to the topmost ancestor window object in the window hierarchy.
The older version of this property is the window._content property, but it is deprecated. For a cross-browser solution, use the top property.
Note that because of security restrictions, the contents of a document can be accessed from another document only if the two documents are located in the same domain.


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

Possible values:

Reference to the topmost window object.
Default: this property has no default value.

Example HTML code 1:

This example illustrates the use of the top property. See the contents of the frameChain.htm and the subFrame.htm files too. You can use the content property instead of the top property in Firefox.
<body style="background-color:#FFFFFF;">
    <h1>The main window</h1>
    <iframe src="frameChain.htm" style="width:400px; height:200px;"></iframe>
Did you find this example helpful? yes no

Supported by objects:

Related pages:

External links:

User Contributed Comments

Post Content

Post Content