Other answers are good ... using .val('')
will do the trick.
I am going to go a little further than what you are asking for, as this may be useful to you and other readers. Here's a general view of the reset function ...
function resetForm(formId) { $(':input', $('#' + formId)).each(function() { var type = this.type; var tag = this.tagName.toLowerCase(); // normalize case if (type == 'text' || type == 'password' || tag == 'textarea') { // it ok to reset the value attr of text inputs, password inputs, and textareas this.value = ""; } else if (type == 'checkbox' || type == 'radio') { // checkboxes and radios need to have their checked state cleared but should *not* have their 'value' changed this.checked = false; } else if (tag == 'select') { // select elements need to have their 'selectedIndex' property set to -1 (this works for both single and multiple select elements) this.selectedIndex = -1; } }); };
Hope this helps.
source share