text: Q:
  
  A simple jQuery function doesn't work
  
  Following is the simple jQuery function but I couldn't figure it out.
  <html>
  <head>
      <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
      <title>Screen Class</title>
  
  <script type="text/javascript" language="javascript"> 
  
     //<![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>=35 && event.keyCode<=40) 
              {
                  // let it happen, don't do anything                       
              }
              else 
              {                               
                  if (event.charCode<48 || event.charCode>57 || event.charCode==16) 
                  {                            
                          event.preventDefault(); 
                  }       
              }                  
          });
      });
     //]]>
  </script>
  
  </head>
  <body onload="getFocus();">
  
  <input type="text" id="txtScreenClassCode"  
      name="txtScreenClassCode"style="background-color: white">
  
  </body>
  </html>
  
  In the above code the jQuery function $(document).ready(function() doesn't work. It is meant to allow only digits in the TextField mentioned. The browser shows an error at the beginning of this function i.e on this line itself $(document).ready(function() that indicates that Object expected. 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 CDATA tag but not to avail.
  
  A:
  
  You need to include jQuery library on the page.
  If you don't have jQuery in your application you can include it from one of the jQuery CDN's mentioned here http://www.jquerycdn.net
  If you don't know how to include jQuery just add this script tag inside the head section of your page markup.
  <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js"></script>
  
  This will include jQuery 1.7 minified js file from Google Ajax API CDN
  
  