English | 简体中文 | 繁體中文 | Русский язык | Français | Español | Português | Deutsch | 日本語 | 한국어 | Italiano | بالعربية
The onkeyup attribute is used to get or set the event handler function for the keyup event of the current element
Execute JavaScript when the user releases the key:
<!DOCTYPE html> <html> <head> <title>Usage of HTML onkeyup Event Attribute (Basic Tutorial Website oldtoolbag.com)</title> </head> <body> <p>The function is triggered when the user releases the key in the input field. The function converts the characters to uppercase.</p> Enter English name: <input type="text" id="fname" onkeyup="myFunction()"> <script> function myFunction() { var x = document.getElementById("fname"); x.value = x.value.toUpperCase(); } </script> </body> </html>Test See ‹/›
IEFirefoxOperaChromeSafari
All major browsers support the onkeyup event attribute
The onkeyup attribute is triggered when the user releases a key (on the keyboard).
Tip: Trigger order of events related to onkeyup:
onkeydown
onkeypress
onkeyup
Note: The onkeyup attribute cannot be used on the following elements: <base>, <bdo>, <br>, <head>, <html>, <iframe>, <meta>, <param>, <script>, <style>, or <title>.
None.
<element onkeyup="script">
Value | Description |
---|---|
script | Specifies the script to be executed when the onkeyup event is triggered. |