<html> <head> <script type="text/javascript"> function checkLen(x,y) { if(y.length==x.maxLength) { var next = x.tabIndex; if(next<document.getElementById("bank").length) { document.getElementById("bank").elements[next].focus(); } } } </script> </head> <body> <div id="bank"> 输入银行卡: <input size="4" tabindex="1" maxlength="4" onkeyup="checkLen(this,this.value)"/> <input size="4" tabindex="2" maxlength="4" onkeyup="checkLen(this,this.value)"/> <input size="4" tabindex="3" maxlength="4" onkeyup="checkLen(this,this.value)"/> <input size="4" tabindex="4" maxlength="4" onkeyup="checkLen(this,this.value)"/> <input size="3" tabindex="5" maxlength="3" onkeyup="checkLen(this,this.value)"/> </div> </body> </html>
时间: 2024-10-14 04:57:00