为什么 document.getElementById   快???

解决方案 »

  1.   

    当然是document.getElementById啦,这个找的是具体的ID
      

  2.   

    哪个快我不清楚,但我知道document.all只能在ie4+运行
      

  3.   

    但它也是从众多ID中找到其ID的呀??
    document.all也是呀?
    看不出来有什么区别呀?
      

  4.   

    document.getElementById是找到自己要的就不再找了。而且document.all是要检索所有的之后,再定位
      

  5.   

    建议不要用 document.all很多非IE浏览器不支持 document.all
      

  6.   

    document.getElementById W3C标准方法
    document.all 是IE专用方法
    谁快谁不快?这得看浏览器是怎么实现的.
    也许在IE的内部实现中 document.getElementById 是调用的 document.all
    就算 document.all 快十倍,我也不会用它
      

  7.   

    document.getElementById是标准,我从来不会用document.all