<div class="htmlarea"><textarea id="runcode16885"> <meta http-equiv="Content-Type" content="text/html; charset=utf-8"> <title>jquery-1.2.6得到焦点与失去焦点的写法</title> <script type="text/javascript" src="http://www.sosuo8.com/jscss/jquery-1.2.6.js"></script> <script type="text/javascript"> $(function(){ $("input:text,input:password,textarea").focus(function(){$(this).css("background","#CBFE9F");}).blur(function(){$(this).css("background","#FFF");}); }); </script> <input type="text"> <input type="password"> <textarea> </textarea><br><input onclick="runEx('runcode16885')" type="button" value="运行代码"> <input onclick="doCopy('runcode16885')" type="button" value="复制代码"> <input onclick="doSave(runcode16885)" type="button" value="保存代码">[Ctrl+A 全选 注:<a href="http://www.jb51.net/article/23421.htm" title="查看具体详情" target="_blank">如需引入外部Js需刷新才能执行</a>]</textarea></div>