JSFiddle - React, Tailwind, and code Playground

by KARTHIKEYAN K

HTML

<fieldset id="checkArray">
    <input type="checkbox" name="chk[]" value="Apples" />

    <input type="checkbox" name="chk[]" value="Bananas" />
</fieldset>

CSS

http://stackoverflow.com/questions/2204250/check-if-checkbox-is-checked-with-jquery

JavaScript

var atLeastOneIsChecked = $('#checkArray:checkbox:checked').length > 0;
//there should be no space between identifier and selector

// or, without the container:

var atLeastOneIsChecked = $('input[name="chk[]"]:checked').length > 0;