Simple way to clear the value of any input inside a div?

前端 未结 8 986
谎友^
谎友^ 2020-12-13 07:36

Is there a simple way to iterate over the child elements in an element, say a div, and if they are any sort of input (radio, select, text, hidden...) clear their v

8条回答
  •  庸人自扰
    2020-12-13 08:33

    $('#div_id input[type=textbox], #div_id select, #div_id textarea').val(''); 
    $('#div_id input[type=radio], #div_id input[type=checkbox]').prop('checked', false);
    

    for jquery.

提交回复
热议问题