/** * 回车时跳转到下一个元素 * @Author HTL * @DateTime 2016-12-30T11:33:25+0800 * @param {[type]} $input [INPUT 元素列表] * @return {[type]} [description] */ function keydown_to_tab($input){ if(!$input) $input = $('input:text:not(:disabled)'); $input.bind("keydown", function(e) { var n = $input.length; if (e.which == 13){ e.preventDefault(); //Skip default behavior of the enter key var nextIndex = $input.index(this) + 1; if(nextIndex < n) $input[nextIndex].focus(); else $input[nextIndex-1].blur(); } }); }
参考:
how-to-set-focus-on-next-textbox-on
From WizNote
最后
以上就是执着芝麻最近收集整理的关于Jquery 实现input回车时跳转到下一个input元素的全部内容,更多相关Jquery内容请搜索靠谱客的其他文章。
本图文内容来源于网友提供,作为学习参考使用,或来自网络收集整理,版权属于原作者所有。
发表评论 取消回复