본문 바로가기

IT 이야기/프로그래밍

자바스크립트 onkeyup 이벤트

336x280(권장), 300x250(권장), 250x250, 200x200 크기의 광고 코드만 넣을 수 있습니다.

자바스크립트 onkeyup 이벤트


input 에 글을 쓰고 나서 발생하는 이벤트

자바스크립트 onkeyup 이벤트

자바스크립트 onkeyup 이벤트
window.onkeyup

1 소스코드[편집]

<!DOCTYPE html>
<meta charset="utf-8" />
<form name='key_form'>
<input type='text' name='key_str' /><br>
<input type='text' name='key_code' /><br>
<input type='reset'/>
</form>
<script>
window.onkeyup = function() {
  key_form.key_code.value += event.keyCode+';';
  key_form.key_str.value += String.fromCharCode(event.keyCode)+';';
}
</script>

2 예제[편집]

3 같이 보기[편집]