Reset custom form elements (jQuery)

I would like to reset several text fields and input files, specifying them manually, as I do with jQuery.

I used this to clear the forms so far:

$('.clear').click(function () {
        $('form#input')[0].reset();
    });
+3
source share
1 answer

This will result in all values ​​of the text fields and inputs in the form being empty:

  $('.clear').click(function() {

       $('form textarea,form input').val('');
  });
+1
source

Source: https://habr.com/ru/post/1752636/


All Articles