ASP.NET中页面加载时文本框内有文字获得焦点时文字消失
<asp:TextBox ID="txtSearch" runat="server" Width="205px" Text="输入想要搜索的项目" OnFocus="javascript:if(this.value=='输入想要搜索的项目') {this.value='';this.style.color='#000000'}"OnBlur="javascript:if(this.value==''){this.value='输入想要搜索的项目';this.style.color='#808080'}" ForeColor="Gray"></asp:TextBox>
转载于:https://www.cnblogs.com/dzj007/archive/2012/03/09/2387652.html
相关资源:JAVA上百实例源码以及开源项目