Set value of hidden field in a form using jQuery’s “.val()” doesn’t work

:text will fail for a input with a type value of hidden. It’s also much more efficient to just use:


ID attributes should be unique on a web page, make sure yours are as this may contribute to any problems you’re having, and specifying a more complicated selector just slows things down and doesn’t look as neat.

Example at, using your example code at[

Leave a Comment