<!DOCTYPE html>
<html>
<body>
Enter your name: <input type="text" id="fname" onfocusout="myFunction()">
<p>When you leave the input field, a function is triggered which transforms the input text to upper case.</p>
<p><strong>Note:</strong> Firefox does not support the onfocusout event.</p>
<script>
function myFunction() {
var x = document.getElementById("fname");
x.value = x.value.toUpperCase();
}
</script>
</body>
</html>