Reputation: 26341
How would I do the following, but exclude any hidden inputs?
$("#new-ticket").find('input,select,textarea').val('');
Upvotes: 0
Views: 53
Reputation: 318372
With :visible
$("#new-ticket").find('input,select,textarea').filter(':visible').val('');
or
$("#new-ticket").find(':input:visible').val('');
the :input
selector selects all input, textarea, select and button elements.
Upvotes: 5