I made a little improvement on Paolo Bergantino's original answer
function resetFormInputs(context) {
jQuery(':input', context)
.removeAttr('checked')
.removeAttr('selected')
.not(':button, :submit, :reset, :hidden')
.each(function(){
jQuery(this).val(jQuery(this).prop('defautValue'));
});
}
In this way, I can pass any context element to the function. I am able to reset the entire form or only a certain set of fields, for example:
resetFormInputs('#form-id'); // entire form
resetFormInputs('.personal-info'); // only the personal info field set
Plus, the default values of the inputs are retained.