if (username) { const legend = document.querySelector('legend h2'); if (legend) { legend.textContent = `WELCOME ${username}`.toUpperCase(); } loginButton.replaceWith(logoutButton); statsNavItem.style.visibility = 'visible'; // Make the stats navigation item visible } else { statsNavItem.style.visibility = 'hidden'; // Hide the stats navigation item }
if (username) { const legend = document.querySelector('legend h2'); if (legend) { legend.textContent = `WELCOME ${username}`.toUpperCase(); } loginButton.replaceWith(logoutButton); statsNavItem.style.visibility = 'visible'; // Make the stats navigation item visible } else { statsNavItem.style.visibility = 'hidden'; // Hide the stats navigation item }
Now my issue is that this statistics page should appear when someone logs in. It does appear but can be accessed from login page and it hidden from each page. How can i make it visible on each page when someone logs in?