62,267
社区成员
发帖
与我相关
我的任务
分享
隐藏显示DIV
<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
<title>无标题页</title>
<script type="text/javascript">
function show()
{
document.getElementById("div").style.display="block";
}
function hide()
{
document.getElementById("div").style.display="none";
}
</script>
</head>
<body>
<form id="form1" runat="server">
<div>
<input id="Button1" type="button" value="显示" onclick="show()" />
<input id="Button2" type="button" value="隐藏" onclick ="hide()" />
</div>
<div id="div">i am div</div>
</form>
</body>
</html>