Window length Property - Javascript Browser Object Model

Javascript examples for Browser Object Model:Window length


The length property returns the number of <iframe> elements in the current window.

This property is read-only.

Return Value

A Number, representing the number of frames in the current window

The following code shows how to check how many <iframe> elements there are in the window:

Demo Code

ResultView the demo in separate window

<!DOCTYPE html>

<iframe src=""></iframe>
<iframe src=""></iframe>
<iframe src=""></iframe>

<button onclick="myFunction()">Test</button>

<p id="demo"></p>

function myFunction() {// ww w .  j a  v  a2  s .  c  o m
    var x = window.length;
    document.getElementById("demo").innerHTML = x;


Related Tutorials