How to disable other checkbox on click of one check box?

前端 未结 4 552
栀梦
栀梦 2020-12-10 21:14

I have a group of check boxes with same name, what I need is when I click any one of them, other checkboxes must get disabled. how should I apply Javascript over it?

4条回答
  •  一整个雨季
    2020-12-10 21:31

    You could do

    $('input').attr('disabled',true);
    

    ...if you really need it. But you might be better off using radio buttons.

    Try the demo

提交回复
热议问题