JSFiddle - React, Tailwind, and code Playground
by CJ Ramki
HTML
<h3>Submit button should be enabled if at least one checkbox is checked</h3>
<form>
<div>
<input type="checkbox" name="op1" id="op1" /> <label for="op1">First Option</label>
</div>
<div>
<input type="checkbox" name="op2" id="op2" /> <label for="op2">Second Option</label>
</div>
<div>
<input type="checkbox" name="op3" id="op3" /> <label for="op3">Third Option</label>
</div>
<div>
<input type="checkbox" name="op4" id="op4" /> <label for="op4">Fourth Option</label>
</div>
<div>
<input type="submit" value="Submit Form" disabled />
</div>
</form>
JavaScript
$("input[type='checkbox']").click(function() {
$("input[type='submit']").attr("disabled", !$("input[type='checkbox']").is(":checked"));
});