scripts/license-osm/script.js
Tykayn 1b66a2d2e5 update style and add tab behavior in osm license
Signed-off-by: tykayn <contact@cipherbliss.com>
2023-08-14 12:02:32 +02:00

19 lines
628 B
JavaScript

let tab_choices = document.querySelectorAll('.tab-choice')
let tabs_content = document.querySelectorAll('.tab-item')
console.log('tab_choices', tab_choices)
tab_choices.forEach(element => {
element.addEventListener('click', (event) => {
console.log('clicked', event)
let attribut = element.getAttribute('data-activate-tab')
console.log('tab_choices', tab_choices)
tabs_content.forEach(element => {
element.classList.remove('active')
})
tab_choices.forEach(element => {
element.classList.remove('active')
})
element.classList.add('active')
document.querySelector(attribut).classList.add('active')
})
})