Reputation:
how to deal with value attribute of any element (hidden input in my case)
i have tried with two styles
alert($("#projectManager").attr("value"));
and
alert($("#projectManager").val());
but it returns 'undefined'.
any help?
Upvotes: 0
Views: 703
Reputation: 27811
Make sure you specify id="projectManager" on the input field. a 'name' attribute is not enough for this selector. And .val() is the way to go to get a field value.
Upvotes: 3