`
tdmlxq
  • 浏览: 37855 次
  • 性别: Icon_minigender_1
  • 来自: 成都
社区版块
存档分类
最新评论

tab键的焦点始终在一个层里面

阅读更多
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
        <title>Untitled Document</title>
        <script type="text/javascript" src="./javascripts/jquery-1.4.2.js"></script>
        <script type="text/javascript">
            $(function(){
                $('.modeDiv input:last').keydown(function(e){
                    if (e.keyCode == 9) {
                        $('.modeDiv input:first').focus();
                        return false;
                    }
                });

            });
        </script>
    </head>
    <body>
        <div class="modeDiv">
            <form action="#" method="post">
                <table class="login_table">
                    <tr>
                        <td>用户名:</td>
                        <td>
                            <input id="username" type="text" size="30" name="username" value="">
                        </td>
                    </tr>
                    <tr>
                        <td>密码:</td>
                        <td>
                            <input id="password" type="password" size="30" name="password" value="">
                        </td>
                    </tr>
                    <tr>
                        <td colspan="2" class="align_right">
                            <input id="login" type="button" value="登录" />
                        </td>
                    </tr>
                </table>
            </form>
        </div>
    </body>
</html>
 
分享到:
评论

相关推荐

Global site tag (gtag.js) - Google Analytics