复制代码 代码如下: <br> fungsi moveNext(objek,indeks){ <br> if(object.value.length==4){ <br> document.forms[0].elemen[index 1].focus(); <br> } <br> } <br> function showResult(){ <br> var f=document.forms[0]; <br> var result=""; <br> untuk(var i=0;i<4;i ){ <br /> hasil =f.elemen[i].nilai; <br /> } <br /> makluman(hasil); <br /> }<br /> </skrip><br> </head> <br> <body onload="document.forms[0].elements[0].focus();"> <br> <borang> <br> <input type="text" size="3" maxlength="4" onkeyup="moveNext(this,0);"> <br> <input type="text" size="3" maxlength="4" onkeyup="moveNext(this,1);"> <br> <input type="text" size="3" maxlength="4" onkeyup="moveNext(this,2);"> <br> <input type="text" size="3" maxlength="4" onkeyup="moveNext(this,3);"> <br> <input type="button" value="显示" onclick="showResult();"> <br> </form> <br> </badan> <br> </html><br> </div> <p><img title="image" alt="" src="http://files.jb51.net/file_images/article/201412/201412230847561.png"></p> <p><img title="image" alt="" src="http://files.jb51.net/file_images/article/201412/201412230847562.png"></p> <p><img title="image" alt="" src="http://files.jb51.net/file_images/article/201412/201412230847573.png"></p> <p><img title="image" alt="" src="http://files.jb51.net/file_images/article/201412/201412230847574.png"></p> <p>代码很简单,功能非常实用,小伙伴们美化下就可以用到自己项目中了,是中了</p>