I have many buttons divided into different panels and I would like to change the color of a button when I click it in jquery. I can not use the solution present in this discussion: Changing the Color of button on Click in bootstrap
$("button").click(function({$("button").removeClass("active");$(this).addClass("active");});
because I must have a button selected for each panel, and with this solution when I click on the button it also deselects me those of the other panels.