GlobalEventHandlers.onkeyup
The onkeyup property returns the onKeyUp event handler code for the current element.
Syntax
JavaScript
Copy Code
element.onkeyup = event handling code
Example
JavaScript
Copy Code
<input type="text" onKeyUp="keyWasPressed(event)"> <script>function keyWasPressed(evt){ console.log(evt.keyCode) }</script>
Notes
The keyup event is raised when the user releases a key that's been pressed.
Specifications
Specification | Status | Comment |
---|---|---|
WHATWG HTML Living Standard The definition of 'onkeyup' in that specification. |
Living Standard |
License
© 2016 Mozilla Contributors
Licensed under the Creative Commons Attribution-ShareAlike License v2.5 or later.
https://developer.mozilla.org/en-us/docs/web/api/globaleventhandlers/onkeyup