<html>
<head>
<script>
function myFunction() {
var x = document.getElementById("fname");
x.value = x.value.toUpperCase();
}
</script>
</head>
<body>
Enter your name: <input type="text" id="fname" onchange="myFunction()">
<p>When you leave the input field, a function is triggered which transforms the input text to upper case.</p>
</body>
<!-- Mirrored from www.w3schools.com/js/tryit.asp?filename=tryjs_events_onchange by HTTrack Website Copier/3.x [XR&CO'2014], Mon, 27 Jan 2020 02:40:41 GMT -->
</html>