X
HOME HTML CSS JAVASCRIPT SQL PHP JQUERY ANGULAR XML ASP.NET MORE...
REFERENCES | EXAMPLES | FORUM | ABOUT

Window length Property

Window Object Reference Window Object

Example

Find the number of frames on a page:

var x = window.length;

The result of x could be:

3

Try it yourself »


Definition and Usage

The length property returns the number of frames (including iframes) in the current window.

Tip: This property is often used together with the window.frames property.


Browser Support

Internet Explorer Firefox Opera Google Chrome Safari

The length property is supported in all major browsers.


Syntax

window.length

Technical Details

Return Value: The number of frames (including iframes) in the current window


More Examples

Example

Find the number of frames on a page, and change the src property of every frame element to "w3schools.com":

for (var i = 0; i < frames.length; i++) {
    frames[i].location="http://www.w3schools.com"
}

Try it yourself »


Window Object Reference Window Object

Your suggestion:

Close [X]

Thank You For Helping Us!

Your message has been sent to W3Schools.

Close [X]
Search w3schools.com:

WEB HOSTING

UK Reseller Hosting

WEB BUILDING

Download XML Editor FREE Website BUILDER Free HTML5 Templates FREE Website Templates Free HTML Templates

SHARE THIS PAGE

facebook