document.all表示整个HTML文档,通过它可以访问/设置HTML文档中的每个元素!

解决方案 »

  1.   

    <html>
    <head>
    <script language=javascript>
    function mm()
    {
        var coll=document.all.tags("FONT");//返回文档中所有FONT元素的集合
        for(var i = 0; i <= coll.length;i++ )
         coll[i].color='red';
    }
    </script>
    </head>
    <body>
    <font>1111111</font><br>
    <font>2222222</font><br>
    <font>3333333</font><br>
    <font>4444444</font><br>
    <input type=button onclick=mm() value="点点我">
    </body>
    </html>
      

  2.   

    还有好多属性,方法自己去查查有关javascript的书看看吧!!
      

  3.   

    document.all是ie专有的属性,我们可以用document.all来访问HTML文档中的每一个元素,它可以根据ID来访问,如:document.all.ID1 就是访问ID为ID1的元素,
    当然它只能在IE中使用,同时,我们可以根据判断document.all是否为空来判断当前的浏览器是否为IE浏览器等等……可以去查查有关javascript的资料/
    http://fason.nease.net/libary/js/jscript5.zip
    http://fason.nease.net/libary/js/1-23.rar
    http://fason.nease.net/libary/js/script56cn.chm
    http://fason.nease.net/libary/js/behavior55.chm