复主代码 代码如下: <머리> 자바스크립트 테스트 <br>window.onload = function() { <br>var EventUtil = { <br>addhandler:function(element,type,handler) { <br>if(element.addEventListenter) { <br>element.addEventListenter(type) ,처리기,false); <br>} else if (element.attachEvent) { <br>element.attachEvent("on" type,handler); <br>} else { <br>요소["on" 유형] = 핸들러; <br>} <br>}, <br><br>getEvent:function(event) { <br>return event?event:window.event; <br>}, <br><br>getTarget:function() { <br>return event.target || event.srcElement; <br>}, <br><br>preventDefault:function() { <br>if(event.preventDefault) { <br>event.preventDefault(); <br>} else { <br>event.returnValue = false; <br>} <br>}, <br><br>stopPropagation:function() { <br>if(event.stopPropagation) { <br>event.stopPropagation(); <br>} else { <br>event.cancelBuddle = true; <br>} <br>}, <br><br>removehandler:function(element,type,handler) { <br>if(element.removeEventListenter) { <br>element.addEventListenter(type,handler,false); <br>} else if (element.detachEvent) { <br>element.detachEvent("on" type,handler); <br>} else { <br>요소["on" 유형] = null; <br>} <br>}, <br><br>getCharCode: function(event) { <br>if(typeof event.charCode == "number") { <br>return event.charCode; <br>} else { <br>return event.keyCode; <br>} <br>}, <br><br>getClipboardText: function(event) { <br>varclipboardData = event.clipboardData || window.clipboardData; <br>clipboardData.getData("text")를 반환합니다. <br>}, <br><br>setClipboardText: function(event,value) { <br>if(event.clipboardData) { <br>return event.clipboardData.setData("text/plain",value); <br>} else if(window.clipboardData){ <br>return window.clipboardData.setData("text",value); <br>} <br>} <br><br>} <br><br>var textarea = document.forms[0].elements["text"]; <br>var 버튼 = document.getElementById("버튼"); <br><br><br>(function() { <br>function tabForward(event) { <br>event = EventUtil.getEvent(event); <br>var target = EventUtil.getTarget(event); <br><br>if(target.value.length == target.maxLength) { <br>var form = target.parentElement; <br><br>for(var i=0,len = form.elements.length;i< ;len-1;i ) { <br>if(form.elements[i] == target) { <br>form.elements[i 1].focus() <br>return <br>} <br>} <br>} <br><br>} <br><br>var textTel1 = document.getElementById("txtTel1"); <br>var textTel2 = document.getElementById("txtTel2") <br>var textTel3 = document.getElementById("txtTel3"); <br><br>EventUtil.addhandler(textTel1,"keyup",tabForward) <br>EventUtil.addhandler(textTel2,"keyup",tabForward) <br>EventUtil .addhandler(textTel3,"keyup",tabForward) <br><br>})(); <br>} <br> <본문> <양식>