Horje

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



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


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

Type:
Html
Category:
Web Tutorial
Sub Category:
Keyboard Events Attribute
Uploaded by:
Admin