Convert lowercase letter to upper case in javascript
<p>I have a <a href="http://www.liewcf.com/archives/2004/04/javascript-convert-characters-to-uppercase-when-typing/">code</a> that will convert lower case letters to uppercase but it works only with IE and not in Crome or Firefox.</p>

<pre><code>function ChangeToUpper()
  {         
            key = window.event.which || window.event.keyCode;

            if ((key &gt; 0x60) &amp;&amp; (key &lt; 0x7B))
            window.event.keyCode = key-0x20;
  }



&lt;asp:TextBox ID="txtJobId" runat="server" MaxLength="10" onKeypress="ChangeToUpper();"&gt;&lt;/asp:TextBox&gt;
</code></pre>

<p>Even I tried with </p>

<pre><code>document.getElementById("txtJobId").value=document.getElementById("txtJobId").value.toUpperCase(); 
</code></pre>

<p><strong>onBlur event of the textbox</strong></p>

<p>What should I do to make it work in all browsers?</p>

<p>Thanks</p>
