Keyboard Events
Keyboard events that occur when the user is manipulating the keyboard.
Common keyboard events are:
- Input, triggered when the value of the <input> or <textarea> element is changed.
- Keydonw is triggered when the user presses any key on the keyboard.
- KeyPress is triggered when the user presses a key on the keyboard and reflects a character on the screen.
- KeyUp is triggered when the user releases a key on the keyboard.
<HTML>
<title>todo Supply a Title</title>
<meta charset= "UTF-8";
<meta name= "viewport" content= "Width=device-width, initial-scale=1.0 "
<body>
<textarea id= "TextArea" ></TEXTAREA>
<p id= "out";
<script>
var EL = document.getElementById (' TextArea ');
El.addeventlistener (' KeyUp ', Checkkey, false);
function Checkkey (e) {
var out = document.getElementById (' Out ');
Out.textcontent = "Press the key for ASCII:" + e.keycode;
}
</script>
</p>
</body>
Javascript&jquery. Keyboard events