<div class="codetitle"> <span><a style="CURSOR: pointer" data="11013" class="copybut" id="copybut11013" onclick="doCopy('code11013')"><u>复制代码</u></a></span> 代码如下:</div> <div class="codebody" id="code11013"> <br> <br> <br><title>Enter2Tab</title> <br><script type="text/javascript"> <BR>window.onload=function(){ <BR>var list = new Array(); <BR>for(var i=5;i<document.all.length;i++) <BR>{ <BR>if(document.all[i].type=="text"||document.all[i].tagName=="SELECT") <BR>list.push(i); <BR>} <br><br>for(var i=0;i<list.length-1;i++) <BR>{ <BR>document.all[list[i]].setAttribute("nextFocusIndex",list[i+1]); <BR>document.all[list[i]].onkeydown=JumpToNext; <BR>} <BR>for(var i=list.length-1;i<document.all.length;i++) <BR>{ <BR>if(document.all[i].type=="button") <BR>{ <BR>document.all[list[list.length-1]].setAttribute("nextFocusIndex",i); <BR>document.all[list[list.length-1]].onkeydown=JumpToNext; <BR>break; <BR>} <BR>} <BR>document.all[list[0]].focus(); <BR>} <BR>function JumpToNext(){ <BR>if(event.keyCode==13) <BR>{ <BR>var nextFocusIndex=this.getAttribute("nextFocusIndex"); <BR>document.all[nextFocusIndex].focus(); <BR>} <BR>} <BR></script> <br> <br> <br><input id="A" name="A" type="text"> <br><input id="B" name="B" type="text"> <br><input id="C" name="C" type="text"> <br><input id="D" name="D" type="text"> <br><input id="E" name="E" type="text"> <br><select id="S1" name="S1"> <br><option>1</option> <br><option>2</option> <br><option>3</option> <br><option>4</option> <br><option>5</option> <br></select> <br><select id="S2" name="S2"> <br><option>1</option> <br><option>2</option> <br><option>3</option> <br><option>4</option> <br></select> </div>