判断访问者用的浏览器支不支持document.getElementById这个方法,如果不支持也不至于报错就是没反应罢了document.all 只有IE支持document.layers 只有Netscape支持document.getElementById 是符合W3C标准