How do I get the value of the input field?
<p>this is my input field:<pre><code>$(&quot;&lt;td class='testclass'&gt;&lt;input id='field-search' value='' type='text'&gt;&lt;/td&gt;&quot;)</code></pre></p>

<p>How do I get the value of the input field?</p>

<p>I tried it this way:</p>

<pre><code>var mytest =$('#field-search').val();
alert(mytest);
</code></pre>

<p>The result is that I get an alert being undefined though the input field has got a value e.g. 10.</p>

<p>Is there a way to get the value when the value of the input field changes?</p>

<p>A link or an example would be very helpful. Thank you.</p>

<p>Link to the code: <a href="http://www.file-upload.net/download-2902420/test.user.js.html" rel="nofollow">http://www.file-upload.net/download-2902420/test.user.js.html</a></p>
