JSFiddle - React, Tailwind, and code Playground

HTML

<input type="checkbox" value="1"/>one
<input type="checkbox" class="odd" value="2"/>two
<input type="checkbox" value="3"/>three
<input type="checkbox" class="odd" value="4"/>four

JavaScript

$('input[type="checkbox"]').change(function(){
    var myArr = []; 
    if($(this).val() == "1"){
        $('.odd').prop('disabled',!$('.odd').attr('disabled'));
    }
    
    $('input[type="checkbox"]:checked').each(function(){
        myArr.push($(this).val());
    }); 
    alert(myArr);
});