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

后端 未结 6 1881
夕颜
夕颜 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 06:50

    What about using the children selector?

    $("#myfieldeset").children().attr("disabled", "disabled");
    

    You can also filter the children selection:

    $("#myfieldeset").children("a,input");
    

提交回复
热议问题