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

前端 未结 5 1935
既然无缘
既然无缘 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:07

    Give the id to your fieldset tag(or u can also use tag name directly in jquery code) & use following code to make all the fields disable in that fieldset using jquery.

    $("#fieldset id" or "fieldset").children().attr("disabled", "disabled");

提交回复
热议问题