Is there any way to disable a bunch of form elements at once?

前端 未结 5 1922
既然无缘
既然无缘 2021-02-02 14:42

I\'d like to disable a section of HTML form elements depending on some conditions. This seems to be the ideal way to do that:

<
5条回答
  •  后悔当初
    2021-02-02 15:16

    Solution using jQuery:

    var disabledFiedset=$('fieldset[disabled]');
    $('input',disabledFiedset).attr('disabled','disabled');
    

提交回复
热议问题