jeudi 5 mars 2020

Is there way to click multiple checkboxes when a option(check box) is on and when it is off you can only select one at a time?

enter image description here I want to be able to perform the functionality in the picture above. It wont work however.

$("#customSwitches").click(function(){
    var $this = $(this);
    if($this.data('clicked')) {
      alert("not element clicked");
      $this.data('clicked', false); 
      $(document).on('click', "#radio1,#radio2,#radio3,#radio4").not(this).prop('checked', false);      
    });
}else {
 alert("element clicked");
         $this.data('clicked', true);
    }
});



Aucun commentaire:

Enregistrer un commentaire