-
Notifications
You must be signed in to change notification settings - Fork 0
/
test.js
32 lines (27 loc) · 868 Bytes
/
test.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
const tabs = document.querySelectorAll("[data-tab-target]");
const tabContents = document.querySelectorAll("[data-tab-content]")
tabs.forEach(tab => {
tab.addEventListener("click", () => {
const target = document.querySelector(tab.dataset.tabTarget);
tabContents.forEach(tabContent =>{
tabContent.classList.remove("active")
})
tabs.forEach(tab => {
tab.classList.remove("active")
})
tab.classList.add("active")
target.classList.add("active")
})
})
function changeOpacity(){
const radioBtn = document.querySelectorAll(".radio-btn")
const checkedRadio = document.querySelectorAll("[name='font']");
for(let i = 0; i < checkedRadio.length; i++){
if(checkedRadio[i].checked){
radioBtn[i].style.opacity= "0.5";
}
if(!checkedRadio[i].checked){
radioBtn[i].style.opacity= "1"
}
}
}