JSFiddle - React, Tailwind, and code Playground
by AnnaGerber
HTML
<script src="http://getbootstrap.com/dist/js/bootstrap.min.js"></script>
<button type="button" class="btn btn-primary" data-toggle="button">My toggle button</button>
<div id="state"></div>
CSS
@import url('http://getbootstrap.com/dist/css/bootstrap.css');
JavaScript
var counter = 0;
$('.btn').on('click', function(){
if ($(this).hasClass('active')){
$('#state').text("active");
} else {
$('#state').text("inactive");
}
})