解决方案 »

  1.   

    从IE 4开始,document.all在IE中举足轻重。比起document.getElementById()来说,document.all是IE方式的获取元素的引用的方法。尽管IE 5增加对DOM的支持,但document.all一直沿用至IE 10。而在Internet Explorer 11中终于被废弃了,这意味着在Internet Explorer 11中使用document.all的方法将可能导致执行失败,尽管使用了document.all的代码实际上还是可以工作。
      

  2.   

    function checkDate() 

      var f1 = document.getElementById("startDate");
      var f2 = document.getElementById("endDate");
      if(f1.value > f2.value)
      { 
         alert("结束日期小于开始日期");
         f2.value = ""; 
       } 
       else
         document.forms[0].submit(); 
       }