Saturday 26 March 2016

Write a JavaScript program to illustrate onKeyup event?

Code:


<!DOCTYPE html>
<html>
<body>
<p>When the user releases a key in the input field, Then function transforms the character to uppercase.</p>
Enter your name:
<input type="text" id="fname" onkeyup="myfunction()">
<script>
    function myfunction()
    {
        var x=document.getElementById("fname");
        x.value=x.value.toUpperCase();
    }
</script>
</body>
</html>


Output:


No comments:

Post a Comment