天天看点

Window length 属性

Window length 属性

Window 对象

length 属性返回在当前窗口中frames的数量(包括IFRAMES)。

window.length

Window length 属性
Window length 属性
Window length 属性
Window length 属性
Window length 属性

所有主要浏览器都支持 length 属性

查找页面上的frames数量,并改变每一frame元素的src属性为"www.runoob.com":

<html>

<body>

<iframe src="http://www.microsoft.com"></iframe>

<iframe src="http://www.google.com"></iframe>

<iframe src="http://www.youtube.com"></iframe>

<script>

for (var i=0; i<frames.length; i++)

{

frames[i].location="http://www.runoob.com"

}

</script>

</body>

</html>

Window length 属性