Issue with jQuery and getting value from textbox
<p>I'm new to jQuery and had the following question...</p>

<p>I have an input box like so: <code>&lt;input class="textbox" id="query" type="text" name="querybox" /&gt;</code>. In jQuery i'm trying to do <code>$('#query').val()</code> and it's not able to get the value. I realized later that it's not even getting the textbox! Although I was following the docs here: 
<a href="http://api.jquery.com/?s=input" rel="nofollow">http://api.jquery.com/?s=input</a></p>

<p>Is there something I'm doing incorrectly?</p>

<p>I have the input box in <code>body &gt; wrapper(div) &gt; content(div)</code>.</p>

<p><strong>EDIT</strong></p>

<p>I took away all of the irrelevant pieces to my code from this:</p>

<pre><code>&lt;!DOCTYPE html&gt;
&lt;html&gt;
&lt;head&gt;
    &lt;title&gt;Test&lt;/title&gt;

    &lt;script type="text/javascript"&gt;
        var a1 = $("#query").val();
        alert('hi');
    &lt;/script&gt;

    &lt;link rel="stylesheet" media="screen" href="/static/stylesheets/main.css"&gt;
    &lt;link rel="stylesheet" media="screen" href="/static/stylesheets/uni_login.css"&gt;
    &lt;link rel="stylesheet" media="screen" href="/static/stylesheets/navigation.css"&gt;
    &lt;script type="text/javascript" src="/static/javascripts/jquery-1.7.1.min.js"&gt;&lt;/script&gt;
    &lt;script type="text/javascript" src="/static/javascripts/jquery.autocomplete-min.js"&gt;&lt;/script&gt;
&lt;/head&gt;
&lt;body&gt;
&lt;div id="wrapper"&gt;
    &lt;div id="content"&gt;
        &lt;input class="textbox" id="query" type="text" name="querybox" /&gt;
    &lt;/div&gt;
&lt;/div&gt;
&lt;/body&gt;
&lt;/html&gt;
</code></pre>

<p>When I take away <code>var a1 = $("#query").val();</code>, I'm seeing the alert. Which tells me there is something wrong with the jquery i'm running...</p>
