Error get value when type a text in javascript
<p>I have a sample code:</p>

<pre><code>&lt;input type="text" value="" class="ac_input"/&gt;
&lt;input type="submit" class="submit" value="GO"/&gt;
$(document).ready(function(){
    $('.submit').click(function(){
         var q = $('.ac_input').val();
         alert(q);
    });  
});
</code></pre>

<p>When I type "test" on input text, result is alert("undefined");</p>

<p>How to fix error when type "test" is result is <code>&lt;input type="text" value="test" class="ac_input"/&gt;</code></p>
