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.
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:
<!DOCTYPE html> <html> <body> <iframe src="https://www.cnn.com"></iframe> <iframe src="https://www.bbc.com"></iframe> <iframe src="https://www.nytimes.com"></iframe> <button onclick="myFunction()">Test</button> <p id="demo"></p> <script> function myFunction() {// ww w . j a v a2 s . c o m var x = window.length; document.getElementById("demo").innerHTML = x; } </script> </body> </html>