A simple jQuery function doesn't work
<p>Following is the simple jQuery function but I couldn't figure it out.</p>

<pre><code>&lt;html&gt;
&lt;head&gt;
    &lt;meta http-equiv="Content-Type" content="text/html; charset=UTF-8"&gt;
    &lt;title&gt;Screen Class&lt;/title&gt;

&lt;script type="text/javascript" language="javascript"&gt; 

   //&lt;![CDATA[
   function getFocus()
   {               
        document.getElementById("txtScreenClassCode").focus();                
   }  

   $(document).ready(function() 
   {                            
        $("#txtScreenClassCode").keypress(function(event) 
        {                                
            if (event.keyCode==46 || event.keyCode==8|| event.keyCode==9 || event.keyCode&gt;=35 &amp;&amp; event.keyCode&lt;=40) 
            {
                // let it happen, don't do anything                       
            }
            else 
            {                               
                if (event.charCode&lt;48 || event.charCode&gt;57 || event.charCode==16) 
                {                            
                        event.preventDefault(); 
                }       
            }                  
        });
    });
   //]]&gt;
&lt;/script&gt;

&lt;/head&gt;
&lt;body onload="getFocus();"&gt;

&lt;input type="text" id="txtScreenClassCode"  
    name="txtScreenClassCode"style="background-color: white"&gt;

&lt;/body&gt;
&lt;/html&gt;
</code></pre>

<hr>

<p>In the above code the jQuery function <code>$(document).ready(function()</code> doesn't work. It is meant to allow only digits in the <code>TextField</code> mentioned. The browser shows an error at the beginning of this function i.e on this line itself <code>$(document).ready(function()</code> that indicates that <strong>Object expected</strong>. What should be wrong with this function? I have teated it with IE and Mozilla Firefox and I also tried to put it into a different directory and enclosed it within the <code>CDATA</code> tag but not to avail.</p>
