I'm trying to get the value of a text field using jQuery, but it is not working.
Below is the test:
I have this in HTML:
<input type="text" id="user_time_zone_offset_hours" name="user_time_zone_offset_hours" value="7"/>
In JavaScript, using jQuery (this does not work):
alert($('#user_time_zone_offset_hours').value); //Result is 'undefined'
In JavaScript, not using jQuery (this works):
alert(document.getElementById("user_time_zone_offset_hours").value); //Result is 7
Why is jQuery returning 'undefined' ?