Closed jichanan closed 1 year ago
HTML: onclick="change_btn(event)", CSS: .active{background-color: red;}
function change_btn(e) {
var btns = document.querySelectorAll(".button");
btns.forEach(function (btn, i) {
if (e.currentTarget == btn) {
btn.classList.add("active");
} else {
btn.classList.remove("active");
}
});
console.log(e.currentTarget);
}
Due date : 2023-03-17 ~ 2023-03-23
구현방법
↑↑example↑↑
작업내용