Enter 포커스를 누르면 다음 컨트롤로 js 코드 이동

1830 단어
 
  


Enter2Tab
<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>








좋은 웹페이지 즐겨찾기