onkeyupEvent

事件对象参考手册Event Object

Examples

Execute JavaScript code when the user releases a keyboard button:

<input type="text" onkeyup="myFunction()">

Try it yourself »

Definition and Usage

The onkeyup event occurs when a keyboard key is released.

Tip:The order of events related to the onkeyup event:

  1. onkeydown
  2. onkeypress
  3. onkeyup

Syntax

In HTML:

<element onkeyup="SomeJavaScriptCode">

In JavaScript:

object.onkeyup=function(){SomeJavaScriptCode};

Parameter Description
SomeJavaScriptCode Required. Specifies the JavaScript to execute when the event occurs.


Browser Support

Internet ExplorerFirefoxOperaGoogle ChromeSafari

All major browsers support the onkeyup event.


HTML tags that support the onkeyup event:

The onkeyup attribute can be applied to all HTML elements except: <base>, <bdo>, <br>, <head>, <html>, <iframe>, <meta>, <param>, <script>, <style>, and <title>.


事件对象参考手册Event Object Other Extensions