Check and Uncheck Checkbox Dynamically with jQuery : bug?

前端 未结 5 2265
我在风中等你
我在风中等你 2021-02-13 02:08

I made a script in order to control master & slave checkboxes (automatic checking and unchecking).

Here is my JS :

$(document).ready(function() {

           


        
5条回答
  •  故里飘歌
    2021-02-13 02:46

    Maybe you just want to check the master checkbox:

    $('#myCheck').click(function() {
           $('.myCheck').attr('checked', false);
           $(this).attr('checked', true);
    });
    

    see this fiddle.

提交回复
热议问题