How to get value of a text field using JavaScript? (jQuery)
<p>I'm trying to get the value of a text field using jQuery, but it is not working.</p>

<p>Below is the test:</p>

<p>I have this in HTML:</p>

<pre><code>&lt;input type="text" id="user_time_zone_offset_hours" name="user_time_zone_offset_hours" value="7"/&gt;
</code></pre>

<p>In JavaScript, <em>using jQuery</em> (this does not work):</p>

<pre><code>alert($('#user_time_zone_offset_hours').value); //Result is 'undefined'
</code></pre>

<p>In JavaScript, <em>not using jQuery</em> (this works):</p>

<pre><code>alert(document.getElementById("user_time_zone_offset_hours").value); //Result is 7
</code></pre>

<p>Why is jQuery returning 'undefined' ?</p>
