Javascript examples for DOM Event:Element Event Attribute
The onkeyup event occurs when the user releases a key.
Bubbles | Yes |
---|---|
Cancelable | Yes |
Supported HTML tags: | All HTML elements, EXCEPT: <base>, <bdo>, <br>, <head>, <html>, <iframe>, <meta>, <param>, <script>, <style>, and <title> |
<!DOCTYPE html> <html> <body> Enter your name: <input type="text" id="fname"> <script> document.getElementById("fname").onkeyup = function() {myFunction()}; function myFunction() {//from w w w . jav a 2 s. com var x = document.getElementById("fname"); x.value = x.value.toUpperCase(); } </script> </body> </html>