km3945
(km3945)
版主
  
版主
UID 46538
精华
0
积分 1327
帖子 1289
金钱 1327 喜悦币
威望 0
人脉 0
阅读权限 100
注册 2004-11-8
状态 离线
|
[推荐阅读] 关于面向对象设计思考……
<?php <b>功能演示:回车 或 TAB 找到下一个 能获取 焦点的对象</b><P> 正常的:<input type="text"><br> 只读的:<input type="text" readonly><br> 正常的:<input type="text"><br> 失效的:<input type="text" disabled value="123"><br> 正常的:<input type="text"><br> 隐藏的:<input type="hidden"><br> 正常的:<input type="text"><br> 文字:一些文字 <br> 正常的:<input type="text"><br> 图片:<img src="http://bbs.51js.com/images/common/xml.gif"><br> 正常的:<input type="text"><br> <script language="javascript"> <!-- document.onkeydown = new Function("if(event.keyCode==13) event.keyCode=9"); Function.prototype.bind = function(){ var self = this; var arg = arguments; return function(){ self.apply(window,arg); } } var inputs = document.getElementsByTagName("input"); for(i=0;i<inputs.length;i++) { if( inputs[i].type=="text") { if( inputs[i].readOnly == true || inputs[i].disabled == true) { var f = function(o){ if(o) o.focus(); } inputs[i].onfocus = f.bind(inputs[i+1]); } } } //--> </script> ?>
|  学会用下半身来思考! |
|