Input box value coming as undefined
<p>I am getting input box value as undefined when appending to a div. 
Below is the code.</p>

<p>JS:</p>

<pre><code>$('#submitHook').click(function () {
    var v = ('#try').val();
    alert(v);
    $('#container').prepend('&lt;tr&gt;&lt;td&gt;' + v + '&lt;/td&gt;&lt;/tr&gt;');
});
</code></pre>

<p>HTML:</p>

<pre><code>&lt;code&gt;
&lt;input type="text" id="try"&gt;&lt;/input&gt;
&lt;input type="button" id="submitHook"&gt;&lt;/input&gt;

&lt;table id="container&gt;&lt;/table&gt;
&lt;/code&gt;
</code></pre>

<p>Also how can the same be exteneded to a textarea?
Appreciate any help. </p>
