<input onkeyup="myFunction()"> - Javascript DOM Event

Javascript examples for DOM Event:onkeyup

Description

The onkeyup event occurs when the user releases a key.

Summary

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

Demo Code

ResultView the demo in separate window

<!DOCTYPE html>
<html>
<body>

Enter your name: <input type="text" id="fname" onkeyup="myFunction()">

<script>
function myFunction() {/*from w  ww.  ja  v a2  s .c om*/
    var x = document.getElementById("fname");
    x.value = x.value.toUpperCase();
}
</script>

</body>
</html>

Related Tutorials