I have a text box with a default value when the page is loaded:
<input id="txtYear" type="text" value="2013" />
After the page is loaded, the user can input something else into the text box, e.g. 2014
.
When I try to do this:
var year = $("#txtYear").val();
The value is still 2013
even though the user changed the text to 2014.
How do I get the value the user input in this case?