English | 简体中文 | 繁體中文 | Русский язык | Français | Español | Português | Deutsch | 日本語 | 한국어 | Italiano | بالعربية
framesA read-only property returns an object similar to an array, representing all <iframe> elements in the current window.
You can access each <iframe> element using an index number, and the index starts from 0.
Usageframes.lengthReturns the number of frames in the current window (including IFRAMES).
Note:This property also applies to <frame> elements. However, HTML5Does not support <frame> element.
window.frames
var fr = window.frames; fr[0].location = "https:"//www.oldtoolbag.com/css-reference/";Test See‹/›
All browsers fully support the frames property:
Property | |||||
frames | Yes | Yes | Yes | Yes | Yes |
Return Value: | Returns a reference to the window object representing the number of all frames in the current window |
---|
Traverse all frames and change the location of all frames:
var list = ["/tags/", "/css-reference/", "/jsref/", "/bootstrap/]; var fm = window.frames; for (let i = 0; i < fm.length;++) { fm[i].location = list[i]; }Test See‹/›
Window (Window) Reference:window.frameElement Property
Window (Window) Reference:window.parent Property
Tag Reference:HTML <iframe> Tag