日期:2014-05-16 浏览次数:20607 次
var tabIndex = 13;
$(":input[tabindex='" + tabIndex + "']", $("#tblGrid2")).focus();
------解决方案--------------------
this在这里不行的楼主,测试了如下可行
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
 <title>修改对象原型</title>
   <script src="Scripts/jquery-1.4.1.js" type="text/javascript"></script>
   <script type="text/javascript">
       window.onload = function () {
           $(":input[tabindex='13']", $("#tblGrid2")).focus();
       }  
</script>
  </head>
  <body>
  <table id="tblGrid2">
<input tabindex=12 />
  <input tabindex=13/>
</table>
  </body>
</html>
  </body>
</html>
<script type="text/javascript">
   window.onload=function(){
       $(":input[tabindex='13']", $("#tblGrid2")).focus();
   }  
</script>