日期:2014-05-17 浏览次数:20474 次
<head runat="server"> <title></title> <style type="text/css"> .jQueryText { font-style:italic; color:#CCCCCC; } </style> <script type="text/javascript" src="JQuery/jquery-1.4.2-vsdoc.js"></script> <script type="text/javascript" language="javascript"> $(function() { var searchBox = $('#<%=TextBox1.ClientID%>'); searchBox.blur(function() { if (searchBox.val() == "") { searchBox.val(this.title); } }); searchBox.focus( function() { if (searchBox.val() == this.title) { searchBox.val(""); } }); }); </script> </head> <body> <form runat="server"> <div> <asp:TextBox ID="TextBox1" width="300px" CssClass="jQueryText" ToolTip="请在这里输入要查询的内容" runat="server"></asp:TextBox> <asp:Button ID="btnSubmit" Text="搜索" runat="server" /> </div> </form> </body> </html>