
1 <html xmlns="http://www.w3.org/1999/xhtml"> 2 <head runat="server"> 3 <title></title> 4 <script src="Scripts/jquery-1.4.1.min.js" type="text/javascript"></script> 5 <style type="text/css"> 6 7 <%-- IE6不支持这种方法--%> 8 <%--input:focus, textarea:focus 9 { 10 border: 1px solid #f00; 11 background:#fcc; 12 }--%> 13 14 .focus 15 { 16 border: 1px solid gray; 17 background:gray; 18 } 19 20 21 </style> 22 <script type="text/javascript"> 23 24 $(function () { 25 $(":input").focus(function () { 26 $(this).addClass("focus"); 27 }).blur(function () { 28 $(this).removeClass("focus"); 29 }); 30 31 }); 32 33 </script> 34 </head> 35 <body> 36 <form id="form1" runat="server" method="post"> 37 <div style="width: 300px; border: 1px solid black"> 38 <fieldset> 39 <legend>个人基本信息</legend> 40 <div> 41 <label for="username"> 42 名称:</label> 43 <input id="username" type="text" /> 44 </div> 45 <div> 46 <label for="pass"> 47 密码:</label> 48 <input id="pass" type="password" /> 49 </div> 50 <div> 51 <label for="msg"> 52 详细信息:</label> 53 <textarea id="msg" rows="5" cols="10"></textarea> 54 </div> 55 </fieldset> 56 </div> 57 </form> 58 </body> 59 </html>
效果图:
锲而不舍,水滴石穿
分类:
jQuery
【推荐】国内首个AI IDE,深度理解中文开发场景,立即下载体验Trae
【推荐】编程新体验,更懂你的AI,立即体验豆包MarsCode编程助手
【推荐】抖音旗下AI助手豆包,你的智能百科全书,全免费不限次数
【推荐】轻量又高性能的 SSH 工具 IShell:AI 加持,快人一步
· Linux系列:如何用heaptrack跟踪.NET程序的非托管内存泄露
· 开发者必知的日志记录最佳实践
· SQL Server 2025 AI相关能力初探
· Linux系列:如何用 C#调用 C方法造成内存泄露
· AI与.NET技术实操系列(二):开始使用ML.NET
· 【自荐】一款简洁、开源的在线白板工具 Drawnix
· 没有Manus邀请码?试试免邀请码的MGX或者开源的OpenManus吧
· 园子的第一款AI主题卫衣上架——"HELLO! HOW CAN I ASSIST YOU TODAY
· 无需6万激活码!GitHub神秘组织3小时极速复刻Manus,手把手教你使用OpenManus搭建本
· C#/.NET/.NET Core优秀项目和框架2025年2月简报