user2538011 user2538011 - 7 months ago 17
Javascript Question

jquery.val() returning undefined

For some reason, probably an obvious one, jquery.val() is returning undefined. Can somebody point out what I'm doing wrong?

<input class=".start" id="Project_StartDate" name="Project.StartDate" value="6.9.2013 0:00:00" type="hidden"/>

$(".start").val() <---- Returns undefined


Better example: http://jsfiddle.net/DvfxF/16/

Answer

your class is wrong, change:

<input class=".start" ...

to

<input class="start" ...