Window length 属性

定义和用法
length 属性返回在当前窗口中frames的数量(包括IFRAMES)。
语法
window.length
浏览器支持
所有主要浏览器都支持 length 属性
实例
实例
查找页面上的frames数量,并改变每一frame元素的src属性为"study.p2hp.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://study.p2hp.com"
}
</script>
</body>
</html>

点我分享笔记