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(); } })