JSFiddle - React, Tailwind, and code Playground

by zlojnaxa

HTML

<input type="checkbox" id="checkBoxAll" name="checkBoxAll">
<input type="checkbox" class="checkboxId" value="${student.id}" name="studentId">
<input type="checkbox" class="checkboxId" value="${student.id}" name="studentId">
<input type="submit" value="Submit" class="btn btn-primary disabled delete_btn" disabled>

JavaScript

$('.checkboxId, #checkBoxAll').on('change',()=> {
    ($('.checkboxId:checked').length || $('#checkBoxAll:checked').length) > 0 ? $('.btn')[0].disabled = false : $('.btn')[0].disabled = true;
});