Hello i am new in javascript so sorry for the elementary question, so i want to make the same action to many button it is easy i want to make buttons actives when i click on it so there is my code:
var button = document.querySelector(".button_cadre_work");
button.addEventListener("click", function(e) {
this.classList.toggle("is-active");
});
var button = document.querySelector(".over_btn");
button.addEventListener("click", function(e) {
this.classList.toggle("is-active");
});
var button = document.querySelector(".button_cadre_about");
button.addEventListener("click", function(e) {
this.classList.toggle("is-active");
});
How can i optimize it for don t repeat evrytime