Button CSS

by JQ Purfect

HTML

<button class="annotation-button">Sample</button>
<button class="annotation-button">Sample</button>

CSS

.selected {
    background: red;
}

JavaScript

$('.annotation-button').click(function(){
    if ($(this).hasClass('selected')) {
        $(this).removeClass('selected');
        //Insert logic if you want a type of optional click/off click code
    }
    else
    {
        $('.annotation-button').removeClass('selected');
        $(this).addClass('selected');
        //Insert event handling logic
    }
})