You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
document.addEventListener('DOMContentLoaded', function() {
let el = document.querySelector('.nav');
if (el) {
el.classList.add('is-open'); // Adding a class properly
const children = Array.from(el.querySelectorAll('li')); // Convert NodeList to array
const textContents = children.map(child => child.textContent);
console.log(textContents); // Log an array of strings
} else {
console.error("Element with class 'nav' not found");
}
document.addEventListener('DOMContentLoaded', function() {
let el = document.querySelector('.nav');
});