9 lines
270 B
JavaScript
9 lines
270 B
JavaScript
const buttons = document.querySelectorAll(".filter-btn");
|
|
buttons.forEach(btn => {
|
|
btn.addEventListener("click", function () {
|
|
buttons.forEach(b => b.classList.remove("active"));
|
|
this.classList.add("active");
|
|
});
|
|
});
|
|
|