disable all form elements inside div

后端 未结 12 1785
栀梦
栀梦 2020-12-04 08:39

is there a way to disable all fields (textarea/textfield/option/input/checkbox/submit etc) in a form by telling only the parent div name in jquery/javascript?

12条回答
  •  轻奢々
    轻奢々 (楼主)
    2020-12-04 08:58

    Try using the :input selector, along with a parent selector:

    $("#parent-selector :input").attr("disabled", true);
    

提交回复
热议问题