Window frames Property
Window Object
Example
Change the src attribute value of the first <iframe> element (index 0):
Try it Yourself »
Definition and Usage
The frames property returns all named frames in the window.
This collection is an array of Window objects, each Window object contains a frame or <iframe> in the window. The property frames.length stores the number of elements contained in the array frames[]. Note that the frames referenced in the frames[] array may also include frames, and they themselves also have frames[] arrays.
Tip:Useframes.lengthto get the number of frames.
Note:This property can also be used for <frame> elements, but HTML5 does not support <frame> elements.
This property is read-only.
Browser Support
| Property | |||||
|---|---|---|---|---|---|
| frames | Yes | Yes | Yes | Yes | Yes |
Syntax
window.frames
Technical Details
| Return Value: | Returns a reference to the Window object, representing all frames of the current window. |
|---|
More Examples
Example
Find the number of all frames in the page, then change the src attribute of the iframe element to "https://www.example.com":
Try it Yourself »
Window Object Other Extensions