阅读221 返回首页    go 阿里云 go 技术社区[云栖]


jQuery实现文本框回车键转tab键

 <script type="text/javascript">
        //功能:将回车键转tab键
        jQuery(function () {
            jQuery('input:text:first').focus();
            var $inp = jQuery('input:text');
            $inp.bind('keydown', function (e) {
                var key = e.which;
                if (key == 13) {
                    e.preventDefault();
                    var nxtIdx = $inp.index(this) + 1;
                    jQuery(":input:text:eq(" + nxtIdx + ")").focus();
                }
            });
        });    
    </script>

最后更新:2017-04-02 00:06:51

  上一篇:go cf 153.div2 D. Playing with Permutations
  下一篇:go Android开发9——Activity的启动模式