자바스크립트 onkeyup 이벤트

Jmnote (토론 | 기여)님의 2013년 10월 26일 (토) 15:19 판 (새 문서: ;자바스크립트 onkeyup 이벤트 ;window.onkeyup ==소스코드== <source lang='html5'> <!DOCTYPE html> <meta charset="utf-8" /> <form name='key_form'> <input type='text' name='...)
(차이) ← 이전 판 | 최신판 (차이) | 다음 판 → (차이)
자바스크립트 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 같이 보기

문서 댓글 ({{ doc_comments.length }})
{{ comment.name }} {{ comment.created | snstime }}