onkeyup event

by fido3993

HTML

<p>
A function is triggered when the user is pressing a key in the input field. The function transform the character to upper case.
</p>
<input type="text" id="fname" onkeyup="myFunction()">

JavaScript

function myFunction() {
	var x = document.getElementById("fname");
  x.value = x.value.toUpperCase();
}