--- title: GlobalEventHandlers.onkeyup slug: Web/API/GlobalEventHandlers/onkeyup translation_of: Web/API/GlobalEventHandlers/onkeyup ---
onkeyup属性用来获取或设置当前元素的keyup
事件的事件处理函数.
element.onkeyup = event handling code
<input type="text" onKeyUp="keyWasPressed(event)"> <script>function keyWasPressed(evt){ alert(evt.keyCode) }</script>
在当前元素上释放键盘按键时会触发keyup事件.
不属于任何公开的规范.
{{ languages( { "fr": "fr/DOM/element.onkeyup", "pl": "pl/DOM/element.onkeyup", "en": "en/DOM/element.onkeyup" } ) }}