English | 简体中文 | 繁體中文 | Русский язык | Français | Español | Português | Deutsch | 日本語 | 한국어 | Italiano | بالعربية

Window length property

JavaScript Window Object

lengthreturns the number of frames in the current window (including IFRAMES).

This property is usually used withwindow.framesproperties are used together.

Note: HTML5The <frame> element is not supported.

Syntax:

window.length
var x = window.length;
Test and See‹/›

Browser Compatibility

All browsers fully support the length property:

Property
lengthYesYesYesYesYes

Technical Details

Return Value:A number representing the number of frames in the current window

More Examples

Traverse all frames and change the position of all frames:

var list = ["/tags/tag-", "/css-reference/", "/jsref/", "/bootstrap/];
var fm = window.frames;
  
for (let i = 0; i < fm.length;++) {
fm[i].location = list[i];  
}
Test and See‹/›

Related References

Window (Window) Reference:window.frames Property

Window (Window) Reference:window.frameElement Property

Tag Reference:HTML <iframe> Tag

JavaScript Window Object