HTML onkeyup Event Attribute

Description

The event attribute onkeyup allows you to set the script to fire after the key is released.

Syntax

<element onkeyup="script">

Values

  • scriptThe name of the script to use when the event has been triggered.

Example

<!DOCTYPE html>
  <html>
    <head>
      <title>Event Attribute onkeyup</title>
    </head>
  <body>
  <p>To demonstrate the onkeyup event attribute, enter your name. This script converts all letters to uppercase (often used in this way when specifying bank data).</p>
  <p>Enter your name:</p>
  <input type="text" id="name" onkeyup="keyboardTest()">
<script>
function keyboardTest() {
  var x = document.getElementById("name")
  x.value = x.value.toUpperCase();
}
</script>
  </body>
</html>

Supported Tags

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

Browser Support

Desktop
Explorer Edge Chrome Firefox Opera Safari
XYesYesYesXX
Tablets / Mobile
Android Chrome Firefox Opera Safari Samsung
YesYesYesXXX