var v = document.getElementByID(id);
v.style.display = "none";
v.style.display = "none";
解决方案 »
- JS 取得网站或者虚拟目录的根地址
- 请问为什么在IE情况下,执行下面document.write代码,js产生的代码不能被id=test的DIV正确包括?
- 晕了 addEventListener怎么往里面传参??
- asp.net 用javaScript获取 省、市、县 级联 县DropDownList 的值
- 弹出一个层,然后,鼠标可以移动到弹出层上,点上面的链接
- javascript中 删除表中 id为某个值 的那一元素
- document.namespaces is undefined
- 请问使用JAVASCRIPT如何在客户端的页面上画出一个方框?
- window的showModalDialog打开的窗口怎么返回值?
- ★☆★☆★☆★■■有JAVASCRIPT高手吗?■■★☆★☆★☆★
- 如何实现用Javascript控制网页打印
- ★★★关于画面关闭时,不进行校验的问题
var oElem = document.getElementById(id);
oElem.style.display = "none"; //隐藏
oElem.style.display = ""; //显示
<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> 清单</strong></td>
</tr>
<tr>
<td width="3%" height="25"><input type="checkbox" name="id" /></td>
<td width="11%"> 序号</td>
<td width="18%"> 名称</td>
</tr>
<tr>
<td height="25"><input type="checkbox" name="id"/></td>
<td> 1</td>
<td> SS46SCB01</td>
</td>
</tr>
<tr>
<td height="35" colspan="9" align="left" bgcolor="#FFFFFF"></td>
</tr>
</table>
</td>
</tr>
</table>
</body>
</html>