How can I disable all elements inside a fieldset in jQuery?

后端 未结 6 1878
夕颜
夕颜 2021-02-07 06:22

I have 2

s on my page, but one of them should have all of it elements disabled depending on some user\'s choice.

The fieldsets contain text

6条回答
  •  臣服心动
    2021-02-07 07:07

    Assuming you set a class="disableMe" on the fieldset you want to disable any input elements then the following code should do what you need:

    $('fieldset.disableMe :input').attr('disabled', true)
    

提交回复
热议问题