-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.js
More file actions
24 lines (22 loc) · 862 Bytes
/
index.js
File metadata and controls
24 lines (22 loc) · 862 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
const tabs = document.querySelectorAll('.tabs li');
const tabContentBoxes = document.querySelectorAll('#tab-content > div');
tabs.forEach((tab) => {
tab.addEventListener('click', () => {
tabs.forEach(item => item.classList.remove('is-active'))
tab.classList.add('is-active');
const target = tab.dataset.target;
tabContentBoxes.forEach(box => {
if(box.getAttribute('id') === target){
box.classList.remove('is-hidden');
}
else{
box.classList.add('is-hidden');
}
})
})
})
document.querySelector(".translation").addEventListener(
'click', () => { document.getElementById("trans_eng")
.classList.remove("is-hidden")
document.querySelector(".translation").classList.add("is-hidden")}
)