website/js/main.js
2023-11-17 16:35:12 +03:00

16 lines
519 B
JavaScript

/* Menu Active Codes */
let targets = document.querySelectorAll('[data-target]')
targets.forEach(element => {
element.addEventListener('click', () => {
var target = document.querySelector(element.dataset.target)
targets.forEach(element2 => {
var target2 = document.querySelector(element2.dataset.target)
element2.style.color = 'var(--menu_text_color)'
target2.style.display = 'none'
});
element.style.color = 'var(--menu_active_text_color)'
target.style.display= 'flex'
})
})