This commit is contained in:
Kirill Pet
2024-10-28 15:52:23 +03:00
parent 928d5c1ffa
commit d9907a0ccd
4 changed files with 145 additions and 27 deletions

View File

@@ -83,9 +83,27 @@ function inputTwo(main, inputTwo) {
button.onclick = function () {
input.checked = (input.checked == false) ? true : false;
}
if (button.dataset.content) {
let content = button.dataset.content,
childrens = document.querySelector(`.${content}`).children;
Object.keys(childrens).forEach(blockId => {
let block = childrens[blockId];
if (block.classList.contains('active')) {
block.classList.remove('active');
}else{
block.classList.add('active');
}
})
// .forEach(block => {
//
// })
}
}
})
}