读书人

怎么在客户端清除 服务器端 textbox 里

发布时间: 2012-02-11 09:51:34 作者: rapoo

如何在客户端清除 服务器端 textbox 里的内容,避免页面刷新
rt
谢谢

[解决办法]
function ClearIt()
{
document.getElementById( "TextBox1 ").value= " ";
}
<input id= "btn " type = "button " onclick= "ClearIt() ">

[解决办法]
<asp:TextBox ID= "TextBox1 " runat= "server "> </asp:TextBox>

<a href=# onclick= "dd() "> asdfasdfasfd </a>
<script type= "text/javascript ">
function dd()
{
document.getElementById( " <%= this.TextBox1.ClientID%> ").value= " ";
}
</script>

读书人网 >asp.net

热点推荐