document.getElementById(1).style.display ="none";这句话 获取不到数据 document.getElementById(1) 为空,所以 调用他的 属性,就抛异常了,JS方法就终止了 你没有ID为1 的 对象