你得用这样的标准语句,标准一些还是不错的.document.forms["表单名"].searchBy表单之外的像DIV的ID名就用document.getElementById("名")你写的这样,在FF和IE8里一律行不通,IE6肯定行。具体的东西,你可以参考一下微软的DOM文档和FF的DOM文档手册。微软的手册网上就有很多下载的地方,FF的手册最好去官网看吧里边是最新的。

解决方案 »

  1.   

    1.
    <select name="searchBy"  id="searchBy"  style="width:70px;"> 
    </select>
    document.getElementById("searchBy").selectedIndex =1; 
    2.
    <select name="list1" id="list1" style="WIDTH: 174px" onchange="On1ItemChange();" >  </select> 
    <img title="name" height="16" src="images/test.gif" width="16" 
    align="absMiddle" onclick="T(document.getElementById('list1'));"/>
      

  2.   

    to 楼上:改完后,原来的errror没了,但在用到的地方出现的如下错误:
    例如:
    1.var selectedIndex = object.selectedIndex;//提示:object is null
    2.for(var i=object.options.length-1; i>=0; --i)//提示:object is null
      

  3.   

    上面的object 参数就是document.getElementById(List1)
      

  4.   

    1.
    <select name="searchBy" id="searchBy"  style="width:70px;">
    </select>
    <script type="text/javascript">
    document.getElementById("searchBy").selectedIndex =1;
    </script>
    2.
    <select name="list1" id="list1" style="WIDTH: 174px" onchange="On1ItemChange();" >  </select>
    <img title="name" height="16" src="images/test.gif" width="16"
    align="absMiddle" onclick="T('list1')"/>把function T()改为function T(id)
    var object=document.getElementById(id);
    for(var i=object.options.length-1; i>=0; --i)
    ...
      

  5.   

    <input name="dateTo1"  value="<%=strEndDate %>"dateTo1.value 出错???
      

  6.   


    var fdate=new Date(year,month-1,date,hh,mm,ss);
    fdate.getYear()错误: fdate.getYear is not a function