JSFiddle - React, Tailwind, and code Playground

by bizamajig

HTML

<div class="btn-group" data-toggle="buttons">
        <label class="btn btn-default">
            <input type="checkbox" name="environment" id="staging" value="staging" />Staging
        </label>
        <label class="btn btn-default">
            <input type="checkbox" name="environment" id="production" value="production" />Production
        </label>
    </div>
<button class="get-active">Get active</button>

<button type="button" class="btn btn-primary" data-toggle="button">
    Single toggle
</button>

JavaScript

$("#production").parent().button('toggle');

        $('.get-active').click(function() {
            var active = $('.btn-group').find('.active input').val();
            alert( active );
        });