Convert string to uppercase in javascript

Example:

 



Code Sample:

<html> <head> <title>Convert string to upper case in JavaScript</title> <script language="Javascript" type="text/javascript"> function converttoupper(t) { try { var strlower = t.value; document.getElementById("tdval").innerHTML = strlower.toUpperCase(); } catch (err) { alert(err.Description); } } </script> </head> <body> <table align="center"> <tr> <td> <input type="text" onkeyup="converttoupper(this);" /> </td> </tr> <tr> <td id="tdval">   </td> </tr> </table> </body> </html>