首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 网站开发 > asp.net >

怎么在客户端清除 服务器端 textbox 里的内容,避免页面刷新

2012-02-11 
如何在客户端清除 服务器端 textbox 里的内容,避免页面刷新rt谢谢[解决办法]function ClearIt(){document.

如何在客户端清除 服务器端 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>

热点排行