Edit in JSFiddle

$('body').on('click', '.btn-group button', function (e) {
    $(this).addClass('active');
    $(this).siblings().removeClass('active');
    
    //do any other button related things
});
<div class="btn-group">
    <button type="button" class="btn btn-default">One</button>
    <button type="button" class="btn btn-default">Two</button>
    <button type="button" class="btn btn-default">Three</button>
</div>
<br></br>
<p>Click one of the buttons and then click anything else. The button now stays selected!</p>