Resetting a multi-stage form with jQuery

前端 未结 30 2068
谎友^
谎友^ 2020-11-22 00:58

I have a form with a standard reset button coded thusly:


Trouble i

30条回答
  •  太阳男子
    2020-11-22 01:20

    Simply use the jQuery Trigger event like so:

    $('form').trigger("reset");
    

    This will reset checkboxes, radiobuttons, textboxes, etc... Essentially it turns your form to it's default state. Simply put the #ID, Class, element inside the jQuery selector.

提交回复
热议问题