Question : How can I clean all inputs?

Is there any way to clean all inputs?
thanks

Answer : How can I clean all inputs?

function clear_form_elements(ele) {
      
          $(ele).find(':input').each(function() {
              switch(this.type) {
                  case 'password':
                  case 'select-multiple':
                  case 'select-one':
                  case 'text':
                  case 'textarea':
                      $(this).val('');
                      break;
                  case 'checkbox':
                  case 'radio':
                      this.checked = false;
              }
          });
      
      }


call this function on event from which you want to clear all inputs. say on any button click...

onclick="clear_form_elements(this.form)"
Random Solutions  
 
programming4us programming4us