document.addEventListener("DOMContentLoaded", function () { const hash = window.location.hash; if (hash) { const activeTab = document.querySelector(`.tab[href="${hash}"], .tab[data-tab="${hash.substring(1)}"]`); if (activeTab) { activeTab.click(); // Activate the correct tab } } else { // Default first tab document.querySelector(".tab")?.click(); } });