From 11e2c01e2d096a8a5b41e61346c7694c4df0b6b6 Mon Sep 17 00:00:00 2001 From: Alena Date: Thu, 23 Oct 2025 20:19:08 +0300 Subject: [PATCH] figma_003 --- main.js | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/main.js b/main.js index d0052d6..648355d 100644 --- a/main.js +++ b/main.js @@ -1,5 +1,10 @@ // -----------------------------------------HEADER----------------------------------------------------------- + const headers = document.querySelectorAll('.header_top_item'); + if(headers.length > 0) { + headers[0].classList.add('active'); +} document.querySelectorAll('.header_top_item').forEach((item) => { + item.addEventListener('click', (e) => { e.preventDefault(); // если не нужно переходить со страницы document.querySelectorAll('.header_top_item').forEach(el => el.classList.remove('active'));