教程集 www.jiaochengji.com
教程集 >  jQuery  >  jquery 教程  >  正文 jquery 实现文本框焦点自动跳转

jquery 实现文本框焦点自动跳转

发布时间:2015-11-08   编辑:jiaochengji.com
本文介绍下,jquery实现文本框焦点自动跳转的一例代码,有需要的朋友,可以参考下。

jquery实现的文本框焦点自动跳转,代码如下:

<div id="BellPhone"> <br> <span id="PortInPstnLabel">电话号码:</span> <input id="BellPhone1" type="text" style="width: 32px;" size="3" maxlength="3" name="BellPhone1" class="bell" >- <input id="BellPhone2" type="text" style="width: 32px;" size="3" maxlength="3" name="BellPhone2" class="bell">- <input id="BellPhone3" type="text" style="width: 40px;" size="4" maxlength="4" name="BellPhone3" class="bell"> </div> $(".bell").keyup(function () { var length = $(this).val().length; if (length == "3") { $(this).next(".bell").focus(); } })

您可能感兴趣的文章:
jquery 实现文本框焦点自动跳转
js 控制页面跳转的五种方法
焦点自动跳转的js实现代码
jquery中focus()函数实现当对象获得焦点后自动把光标移到内容最后
js实现用户登录自动跳转的代码
基于jquery实现的移入页面上空文本框时,让它变为焦点,移出清除焦点
js实现页面加载时获取input文本框焦点
jQuery 在光标定位的地方插入文字的插件
jQuery回车键切换文本框焦点
js 3秒后跳转页面实例代码

[关闭]
~ ~