var v = document.getElementByID(id);
v.style.display = "none";

解决方案 »

  1.   

    给元素设置id值,然后
    var oElem = document.getElementById(id);
    oElem.style.display = "none"; //隐藏
    oElem.style.display = ""; //显示
      

  2.   

    <html>
    <head>
    <title></title>
    <script>
    <!--
    function findObj(theObj, theDoc){  var p, i, foundObj;    if(!theDoc) theDoc = document;  if( (p = theObj.indexOf("?")) > 0 && parent.frames.length){    theDoc = parent.frames[theObj.substring(p+1)].document;    theObj = theObj.substring(0,p);  }  if(!(foundObj = theDoc[theObj]) && theDoc.all) foundObj = theDoc.all[theObj];  for (i=0; !foundObj && i < theDoc.forms.length; i++)     foundObj = theDoc.forms[i][theObj];  for(i=0; !foundObj && theDoc.layers && i < theDoc.layers.length; i++)     foundObj = findObj(theObj,theDoc.layers[i].document);  if(!foundObj && document.getElementById) foundObj = document.getElementById(theObj);  return foundObj;}
    //-->
    </script>
    </head><body>
    <table width="100%" border="0" cellpadding="0" cellspacing="0" bordercolor="#FFFFFF">
       <tr>
          <td height="25" align="left">
    <input name="OK2" type="submit" class="buttontwo" value="货物详单" onMouseUp="with(findObj('equipment'))if(style.display=='none'){style.display=''}else{style.display='none'}"/></td>
       </tr>
    </table>
        <table width="100%" border="1" id="equipment" style="display:none">
             <tr>
              <td height="22" colspan="9" align="left" bgcolor="#FFFFFF"><strong>&nbsp;清单</strong></td>
              </tr> 
      <tr>
                <td width="3%" height="25"><input type="checkbox" name="id" /></td>
                <td width="11%">&nbsp;&nbsp;序号</td>
                <td width="18%">&nbsp;&nbsp;名称</td>            
              </tr>
              <tr>
                <td height="25"><input type="checkbox" name="id"/></td>
                <td>&nbsp;&nbsp;1</td>
                <td>&nbsp;&nbsp;SS46SCB01</td>
               </td>
              </tr>
       <tr>
              <td height="35" colspan="9" align="left" bgcolor="#FFFFFF"></td>
              </tr>
          </table>
      </td>
        </tr>
    </table>
    </body>
    </html>