![]() |
The HTML
onkeyup
event attribute is used to execute a script or function when a user releases a key on the keyboard. This attribute can be applied to various HTML elements, commonly input fields and text areas, to enable dynamic responses to user input. |
Example:
HTML
<input type="text" onkeyup="myFunction()">
The onkeyup attribute fires when the user releases a key (on the keyboard).
Tip: The order of events related to the onkeyup event:
<
element
onkeyup="
script
">
Value | Description |
---|---|
script | The script to be run on onkeyup |
Supported HTML tags: | All HTML elements, EXCEPT: <base>, <bdo>, <br>, <head>, <html>, <iframe>, <meta>, <param>, <script>, <style>, and <title> |
---|
A function is triggered when the user releases a key in the input field. The function transforms the character to upper case.
Example:
HTML
<!DOCTYPE html>
<html>
<body>
<p>A function is triggered when the user releases a key in the input field. The function transforms the character to upper case.</p>
Enter your name: <input type="text" id="fname" onkeyup="myFunction()">
<script>
function myFunction() { let x = document.getElementById("fname"); x.value = x.value.toUpperCase();
}
</script>
</body>
</html>
html event attributes |
List of Keyboard Events Attribute | HTML Keyboard Events Attribute |
HTML onkeydown Event Attribute | HTML Keyboard Events Attribute |
HTML onkeypress Event Attribute | HTML Keyboard Events Attribute |
HTML onkeyup Event Attribute | HTML Keyboard Events Attribute |
Example of HTML onkeyup Event Attribute | HTML Keyboard Events Attribute |
Definition and Usage of HTML onkeyup Event Attribute | HTML Keyboard Events Attribute |
Browser Support of HTML onkeyup Event Attribute | HTML Keyboard Events Attribute |
Syntax of HTML onkeyup Event Attribute | HTML Keyboard Events Attribute |
Attribute Values of HTML onkeyup Event Attribute | HTML Keyboard Events Attribute |
Technical Details of HTML onkeyup Event Attribute | HTML Keyboard Events Attribute |
How to Execute a JavaScript when a user releases a key | HTML Keyboard Events Attribute |
Type
: |
Develop |
Category
: |
Web Tutorial |
Sub Category
: |
HTML Keyboard Events Attribute |
Uploaded by
: |
Admin |
Read Article https://horje.com/learn/1434/reference