Window parent Property - Javascript Browser Object Model

Javascript examples for Browser Object Model:Window parent


The parent property returns the parent window of the current window.

This property is read-only.

Return Value

The parent window object of the current window

The following code shows how to change the background-color of an <iframe> element's parent document:

Demo Code

ResultView the demo in separate window

<!DOCTYPE html>

<iframe id="myframe" src="" width="100%" height="500" style="background:#f1f1f1;">
  <p>Your browser does not support iframes.</p>
</iframe>//from w w w .j  a v  a  2 s  .co m


Related Tutorials