<div class="htmlarea"> <textarea id="runcode57592"> <title></title> <style type="text/css"> *{ margin:0px;padding:0px;font-size:12px; } input{ width:100px;height:20px;border:1px solid #ccc; } </style> <script language="javascript"> function tips(id,str){ var l=document.getElementById(id).offsetLeft+120; var t=document.getElementById(id).offsetTop; document.getElementById("tips").innerHTML="提示:"+str; document.getElementById("tips").style.left=l+"px"; document.getElementById("tips").style.top=t+"px"; document.getElementById("tips").style.display=""; } function outtips(){ document.getElementById("tips").style.display='none'; } </script> <div id="tips" style="position:absolute;border:1px solid #ccc;padding:0px 3px;color:#f00;display:none;height:20px;line-height:20px;background:#fcfcfc"></div> 姓名:<input type="text" id="username" onfocus="tips('username','姓名长度最多16个字符')" onblur="outtips()"> 密码:<input type="password" id="password" onfocus="tips('password','密码长度必须在3-18位之间')" onblur="outtips()"> </textarea><br><input onclick="runEx('runcode57592')" type="button" value="运行代码"> <input onclick="doCopy('runcode57592')" type="button" value="复制代码"> <input onclick="doSave(runcode57592)" type="button" value="保存代码">[Ctrl+A 全选 注:<a href="http://www.jb51.net/article/23421.htm" title="查看具体详情" target="_blank">如需引入外部Js需刷新才能执行</a>]</div> <br>比较简单,自己闲着无聊写的,很久没有写过代码了。。。。 <br>