Horje
What is HTML onkeyup Event Attribute
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 of HTML onkeyup Event Attribute

It will Execute a JavaScript when a user releases a key.
index.html
Example: HTML
 <input type="text" onkeyup="myFunction()"> 

Output should be:

Example of HTML onkeyup Event Attribute

Definition and Usage of HTML onkeyup Event Attribute

The onkeyup attribute fires when the user releases a key (on the keyboard).

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

  1. onkeydown
  2. onkeypress
  3. onkeyup

Browser Support of HTML onkeyup Event Attribute

Output should be:

Browser Support of HTML onkeyup Event Attribute

Syntax of HTML onkeyup Event Attribute

<element onkeyup="script">

Attribute Values of HTML onkeyup Event Attribute

Value Description
script The script to be run on onkeyup

Technical Details of HTML onkeyup Event Attribute

Supported HTML tags: All HTML elements, EXCEPT: <base>, <bdo>, <br>, <head>, <html>, <iframe>, <meta>, <param>, <script>, <style>, and <title>

How to Execute a JavaScript when a user releases a key

A function is triggered when the user releases a key in the input field. The function transforms the character to upper case.

index.html
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>

Output should be:

How to Execute a JavaScript when a user releases a key




html event attributes

Related Articles
List of Keyboard Events Attribute Keyboard Events Attribute
What is HTML onkeydown Event Attribute Keyboard Events Attribute
What is HTML onkeypress Event Attribute Keyboard Events Attribute
What is HTML onkeyup Event Attribute Keyboard Events Attribute

Single Articles
Example of HTML onkeyup Event AttributeKeyboard Events Attribute
Definition and Usage of HTML onkeyup Event AttributeKeyboard Events Attribute
Browser Support of HTML onkeyup Event AttributeKeyboard Events Attribute
Syntax of HTML onkeyup Event AttributeKeyboard Events Attribute
Attribute Values of HTML onkeyup Event AttributeKeyboard Events Attribute
Technical Details of HTML onkeyup Event AttributeKeyboard Events Attribute
How to Execute a JavaScript when a user releases a keyKeyboard Events Attribute

Read Full:
Keyboard Events Attribute
Type:
Develop
Category:
Web Tutorial
Sub Category:
Keyboard Events Attribute
Uploaded by:
Admin
Views:
16


Reffered: https://www.w3schools.com/tags/ev_onkeyup.asp