代码如下:
<head runat="server">
<title></title>
<script type="text/javascript" language="javascript">
function change() { document.getElementById("Button1").Visible = false;
}
</script></head>
<body>
<form id="form1" runat="server">
<div id="yincang">
<asp:TextBox ID="TextBox1" runat="server" onblur="change()"></asp:TextBox>
<asp:Button ID="Button1" runat="server" Text="Button" />
</div>
</form>
</body>
<head runat="server">
<title></title>
<script type="text/javascript" language="javascript">
function change() { document.getElementById("Button1").Visible = false;
}
</script></head>
<body>
<form id="form1" runat="server">
<div id="yincang">
<asp:TextBox ID="TextBox1" runat="server" onblur="change()"></asp:TextBox>
<asp:Button ID="Button1" runat="server" Text="Button" />
</div>
</form>
</body>
}
style.display="none"; 显示就是'block' 。
--------------------------------------------------------------------
document.getElementById("Button1").style.display= none;
function HideButton(){
document.getElementById("<%=服务器控件ID.ClientID %>").style.display="none";
}