function loadpage(temp)
{
  var B = document.all(temp).style.display=="none";
  document.all(temp).style.display=B ? "inline" : "none";
}<div id="mydiv" class="mydiv"><a href="#" oncick='loadpage("mydiv"); return false'>你的问题主要是在 document.all(temp) 这个变量名转换成对象时出错

解决方案 »

  1.   

    <SCRIPT language="javascript">
    var dis=0
    function loadpage(temp)
    {    
          if (dis%2==0)
            { 
             document.all(temp).style.display="inline";
            }
          if (dis%2==1)
            {
             document.all(temp).style.display="none";
            }
         dis=dis+1;
    }
    </SCRIPT>
      

  2.   

    你自己再看看吧, <DIV> 里是 id=mydiv 而不是 name=mydiv 
    函数里用 document.all(temp)
      

  3.   

    <div name=d1 id=d1 style="display:none">
    <TABLE WIDTH=100 height=100  bgcolor=#ff4500>
    <TR>
    <TD>测试一下</TD>
    </TR>
    </TABLE>
    </div><input type=button onclick="vbscript:show()" value="显示" id=button1 name=button1>
    <input type=button onclick="vbscript:show1()" value="隐藏" id=button2 name=button2><script language=vbscript>
    function show()
    d1.style.display=""
    end functionfunction show1()
    d1.style.display="none"
    end function
    </script>
      

  4.   

    <SCRIPT language="javascript">
    var dis=0
    function loadpage(temp)
    {    
          if (dis%2==0)
            { 
             document.all[temp].style.display="inline";
            }
          if (dis%2==1)
            {
             document.all[temp].style.display="none";
            }
         dis=dis+1;
    }</SCRIPT><a href="#" onclick='loadpage(<%=cstr(rs("seqno"))%>)'>&nbsp;+&nbsp;</a><div id=<%=cstr(rs("seqno"))%> class="faultall">
                       <table>
                          <tr>
                            <td>chengsdfsdfsdf</td>
                            <td>ddddddddiiiii</td>
                          </tr>
                       </table>
                      </div>  这样又不行了???
      

  5.   

    <a href="#" onclick='loadpage(<%=cstr(rs("seqno"))%>)'>&nbsp;+&nbsp;</a>你给定的参数名字竟然引号都不括了. ??
    onclick='loadpage("<%=cstr(rs("seqno"))%>")' 要注意呀