Window parent Property - Javascript Browser Object Model

Javascript examples for Browser Object Model:Window parent

Description

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>
<html>
<body>

<iframe id="myframe" src="http://java2s.com" 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

</body>
</html>

Related Tutorials