JSFiddle - React, Tailwind, and code Playground

HTML

<div id='foo'>
    <input type='checkbox' value='english' name='bar[english]' />
    <input type='checkbox' value='spanish' name='bar[spanish]' />

    <button type='button' class='button'>Me!</button>
</div>

JavaScript

$('.button').click(function() {
    status = '';
    $('#foo input[name*="bar"]').each(function() {
        status += $(this).val() + ': ' + $(this).is('checked') + ".\n";
    });
    alert(status);
});