<table id="t1" width="200" border="1"><tr><td>Test</td></tr></table>
<input type="button" value=" Test " onClick="t1.style.display=t1.style.display==''?'none':''">
<input type="button" value=" Test " onClick="t1.style.display=t1.style.display==''?'none':''">
解决方案 »
- EXTJS中JsonStore 定义本地数据data的问题
- 点击提交按钮后,显示遮罩层,页面加载完毕后,关闭遮罩层
- 【急】jquery tabs事件绑定是怎么回事
- .\b. 匹配 @@@abc 中的 @ab怎么解释啊?
- js中的/^\w+([-+.]\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*$/,
- js if 时间验证判断
- 问大牛们一个createElement()的问题
- 如何用JavaScript实现表单变量的运算和传递?
- 关于为IFrame里的元素赋值和读取IFrame里元素的值的问题!
- 纯使用js制作ASP,谁作过?
- 我的论坛中的问题,希望得到大家的帮助
- 偶无法理解的怪问题?(关于表单)
<head runat="server">
<title>无标题页</title>
<script language="javascript" type="text/javascript">
Function aaa(){
if(document.form1.ValueTable.style.display == 'none')
{document.form1.ValueTable.style.display='';}
else
{document.form1.ValueTable.style.display='none';}
}
</script>
</head>
<body>
<form id="form1" runat="server">
<div>
<table id="ValueTable" style="display:block;" border="1" >
<tr>
<td style="width: 257px">
</td>
<td style="width: 430px">
<input id="Button2" type="button" value="button" />
<input id="Button3" type="button" value="button" /></td>
<td style="width: 161px">
</td>
</tr>
</table>
</div>
<input id="Button1" type="button" value="button" onclick="aaa()" />
</form>
</body>
</html>
帮忙看看!哪错了!
实现功能,点击一次按钮!显示table,再点击一次隐藏table。
下面这个不知道能不能帮你,
<html >
<head >
<title>无标题页</title>
<script language="javascript">
function aaa(){
document.all.showupdate.style.display='none';
document.all.show2.style.display='block';
document.all.show3.style.display='none';
}
function aa(){
document.all.showupdate.style.display='block';
document.all.show2.style.display='none';
document.all.show3.style.display='block';
}
</script>
</head>
<body>
<form id="form1" runat="server">
<div>
<span id="showupdate" style="display:block">
<table border="1" >
<tr>
<td style="width: 257px">
</td>
<td style="width: 430px">
<input id="Button2" type="button" value="一" />
<input id="Button3" type="button" value="二" /></td>
<td style="width: 161px">
</td>
</tr>
</table>
</span>
</div>
<span id="show3" style="display:block">
<input id="Button1" type="button" value="按钮1" onclick="aaa();"/>
</span>
<span id="show2" style="display:none">
<input id="Button1" type="button" value="按钮2" onclick="aa();"/>
</span>
</form>
</body>
</html>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
<title>无标题页</title>
<script language="javascript" type="text/javascript">
function aaa(){
if(document.getElementById("ValueTable").style.display == 'none')
{document.getElementById("ValueTable").style.display='';}
else
{document.getElementById("ValueTable").style.display='none';}
}
</script>
</head>
<body>
<form name="form1" runat="server">
<div>
<table id="ValueTable" style="display:block;" border="1" >
<tr>
<td style="width: 257px">
</td>
<td style="width: 430px">
<input id="Button2" type="button" value="button" />
<input id="Button3" type="button" value="button" /></td>
<td style="width: 161px">
</td>
</tr>
</table>
</div>
<input id="Button1" type="button" value="button" onclick="aaa()" />
</form>
</body>
</html>
function aaa(){
var obj=document.getElementById("ValueTable");
if(obj.style.display == 'none')
{obj.style.display='';}
else
{obj.style.display='none';}
}
</script>