JavaScript Program to Convert Text to Uppercase Using 'oninput' KeyEvent

Write a JavaScript program to convert text to uppercase using 'oninput' keyevent.



Source Code
<html>
<head>
    <title>Change text to Uppercase</title>
    <script>
        function upperMe(txt) 
        {
            document.getElementById('output').value = txt.toUpperCase();
        }
    </script>
</head>
<body>
<p>Enter lowercase letters for conversion to Uppercase</p>
Enter text here <input type="text" id="input" value="sample" oninput="upperMe(this.value)"><br><br>
String in UPPERCASE <input type="text" id="output" value="">
</body>
</html>
Output





"Coding Hub - Learn to code" app now available on Google Play Store