Latest web development tutorials

Window frames property

Window Object Reference Window object

Definition and Usage

frames property returns the window frame all named.

This collection is an array of Window objects, each containing a Window object in a window frame or <iframe>. The number of elements in the array to store property frames.length frames [] contained. Note that frame frames [] array may also include a reference frame, also have their own frames [] array.

Tip: Use frames.length to obtain the number of the frame.

grammar

window.frames


Browser Support

Internet ExplorerFirefoxOperaGoogle ChromeSafari

All major browsers support frames property


Examples

Examples

Find the number of all frames on the page, and then modify the frame element src attribute "w3cschool.cc":

<html>
<body>

<iframe src="http://microsoft.com"></iframe>
<iframe src="http://google.com"></iframe>
<iframe src="http://youtube.com"></iframe>

<script>
for (var i=0; i<frames.length; i++)
{
frames[i].location="http://w3cschool.cc"
}
</script>

</body>
</html>



Window Object Reference Window object