Javascript examples for DOM Event:addEventListener
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").addEventListener("keyup", myFunction); function myFunction() {//ww w. ja v a2s . c om var x = document.getElementById("fname"); x.value = x.value.toUpperCase(); } </script> </body> </html>