17 lines
557 B
JavaScript
17 lines
557 B
JavaScript
{889b83e6e025e23c922c634b82ace31f0bb0eb4b true 557 main.js 0xc001ec7260}
let tabs = document.querySelectorAll(".tabs li");
|
|
let tabsArray = Array.from(tabs);
|
|
let divs = document.querySelectorAll(".content > div");
|
|
let divsArray = Array.from(divs);
|
|
|
|
tabsArray.forEach((ele) => {
|
|
ele.addEventListener("click", function (e) {
|
|
tabsArray.forEach((ele) => {
|
|
ele.classList.remove("active");
|
|
});
|
|
e.currentTarget.classList.add("active");
|
|
divsArray.forEach((div) => {
|
|
div.style.display = "none";
|
|
});
|
|
document.querySelector(e.currentTarget.dataset.cont).style.display = "block";
|
|
});
|
|
}); |