took me for a minute but realized this is jsfiddle example
sorry it didn’t save.
EDIT now without class
here is the html
<input type="text" name="foo" /> <input type="hidden" name="hidden" id="bar" value="surprise" /> <input type="submit" name="submit" />
here is jQuery
var inputSelector = 'input:not(:button, :submit, :reset,:hidden), textarea, select'; $(inputSelector).val('foobar'); var bc = $('#bar').val(); alert(bc);
The warning should say “surprise” because the hidden element with the “bar” is not selected
source share