JavaScript Program to Capitalise All Text in TextBox

Write a JavaScript program to capitalise all text given in textbox.



Source Code
<html>
<head>
    <title>User name form</title>
</head>
<script>
    function toUpper(n) {
        document.getElementById('name').value = n.toUpperCase();
    }
</script>
<body>
<form>
First name <input type="text" id="name" oninput="toUpper(this.value)"/>
<br/>
<p id="para" onmouseover="this.style.color='red'" onmouseout="this.style.color='black'">Plz enter name</p>
</form>
</body>
</html>
Output