JavaScript
0
Вклад в тег
var button1Active = false;
var button2Active = true;
var button3Active = false;
function buttonActive(btn_name, btn_active) {
$(btn_name).on('click', function(){
btn_active = !btn_active;
$(this).toggleClass('button_active', button1Active);
}).toggleClass('button_active', button1Active);
}
buttonActive('.button_1', button1Active);
buttonActive('.button_2', button2Active);
buttonActive('.button_3', button3Active);