在asp中如何隐藏div,在点击按钮后显示div中的内容
<tablewidth="650"border="0"align="center"cellpadding="0"cellspacing="0"><formname="fo...
<table width="650" border="0" align="center" cellpadding="0" cellspacing="0">
<form name="form" method="post" action="?">
<tr align="center" valign="middle">
<td width="33%" height="35">
<div align="center"><font size="3">
专业名称:</span>
<input name="key" type="text" class="wenbenkuang" id="key" size="30" style="BORDER-RIGHT: #debac1 1px solid; BORDER-TOP: #debac1 1px solid; FONT-SIZE: 12pt; BORDER-LEFT: #debac1 1px solid; BORDER-BOTTOM: #debac1 1px solid">
<input name="Submit22" type="submit" class="go-wenbenkuang" size="30" value="查 找" style="BORDER-RIGHT: #debac1 1px solid; BORDER-TOP: #debac1 1px solid; FONT-SIZE: 11pt; BORDER-LEFT: #debac1 1px solid; BORDER-BOTTOM: #debac1 1px solid">
</div></td>
</tr>
</form>
<div id="div1" name="div1">
<table width="126%" border="0" align="center" cellpadding="2" cellspacing="1" bgcolor="#CCCCCC">
<tr valign="middle" bgcolor="#f1f1f1">
<td>内容
</td>
</tr>
</table>
</div>
</table>
如何用js控制 求大侠帮忙 急!!!!!!!!!!!!!!!!!! 展开
<form name="form" method="post" action="?">
<tr align="center" valign="middle">
<td width="33%" height="35">
<div align="center"><font size="3">
专业名称:</span>
<input name="key" type="text" class="wenbenkuang" id="key" size="30" style="BORDER-RIGHT: #debac1 1px solid; BORDER-TOP: #debac1 1px solid; FONT-SIZE: 12pt; BORDER-LEFT: #debac1 1px solid; BORDER-BOTTOM: #debac1 1px solid">
<input name="Submit22" type="submit" class="go-wenbenkuang" size="30" value="查 找" style="BORDER-RIGHT: #debac1 1px solid; BORDER-TOP: #debac1 1px solid; FONT-SIZE: 11pt; BORDER-LEFT: #debac1 1px solid; BORDER-BOTTOM: #debac1 1px solid">
</div></td>
</tr>
</form>
<div id="div1" name="div1">
<table width="126%" border="0" align="center" cellpadding="2" cellspacing="1" bgcolor="#CCCCCC">
<tr valign="middle" bgcolor="#f1f1f1">
<td>内容
</td>
</tr>
</table>
</div>
</table>
如何用js控制 求大侠帮忙 急!!!!!!!!!!!!!!!!!! 展开
2个回答
展开全部
<script>
var num=false;
function showDIV()
{
if(num=!num)
{
document.getElementById("DIV").style.display="block";
}
else
{
document.getElementById("DIV").style.display="none";
}
}
</script>
把你的代码改了:
<table width="650" border="0" align="center" cellpadding="0" cellspacing="0">
<form name="form" method="post" action="?" onSubmit="return false">
<tr align="center" valign="middle">
<td width="33%" height="35">
<div align="center"><font size="3">
专业名称:</span>
<input name="key" type="text" class="wenbenkuang" id="key" size="30" style="BORDER-RIGHT: #debac1 1px solid; BORDER-TOP: #debac1 1px solid; FONT-SIZE: 12pt; BORDER-LEFT: #debac1 1px solid; BORDER-BOTTOM: #debac1 1px solid">
<input name="Submit22" type="submit" class="go-wenbenkuang" size="30" value="查 找" onClick="showDIV()" style="BORDER-RIGHT: #debac1 1px solid; BORDER-TOP: #debac1 1px solid; FONT-SIZE: 11pt; BORDER-LEFT: #debac1 1px solid; BORDER-BOTTOM: #debac1 1px solid">
</div></td>
</tr>
</form>
</table>
<div id="DIV" name="DIV" style="display:none;" >
<table width="126%" border="0" align="center" cellpadding="2" cellspacing="1" bgcolor="#CCCCCC">
<tr valign="middle" bgcolor="#f1f1f1">
<td>内容
</td>
</tr>
</table>
</div>
var num=false;
function showDIV()
{
if(num=!num)
{
document.getElementById("DIV").style.display="block";
}
else
{
document.getElementById("DIV").style.display="none";
}
}
</script>
把你的代码改了:
<table width="650" border="0" align="center" cellpadding="0" cellspacing="0">
<form name="form" method="post" action="?" onSubmit="return false">
<tr align="center" valign="middle">
<td width="33%" height="35">
<div align="center"><font size="3">
专业名称:</span>
<input name="key" type="text" class="wenbenkuang" id="key" size="30" style="BORDER-RIGHT: #debac1 1px solid; BORDER-TOP: #debac1 1px solid; FONT-SIZE: 12pt; BORDER-LEFT: #debac1 1px solid; BORDER-BOTTOM: #debac1 1px solid">
<input name="Submit22" type="submit" class="go-wenbenkuang" size="30" value="查 找" onClick="showDIV()" style="BORDER-RIGHT: #debac1 1px solid; BORDER-TOP: #debac1 1px solid; FONT-SIZE: 11pt; BORDER-LEFT: #debac1 1px solid; BORDER-BOTTOM: #debac1 1px solid">
</div></td>
</tr>
</form>
</table>
<div id="DIV" name="DIV" style="display:none;" >
<table width="126%" border="0" align="center" cellpadding="2" cellspacing="1" bgcolor="#CCCCCC">
<tr valign="middle" bgcolor="#f1f1f1">
<td>内容
</td>
</tr>
</table>
</div>
本回答被提问者采纳
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询