function onload() { if (sessionStorage.getItem('sgaEnabled')) { enableSGA() } else { disableSGA() } } function enableSGA() { document.getElementById("body").style.fontFamily = "standardGalactic, system-ui"; document.getElementById("body").style.fontWeight = "lighter"; sessionStorage.setItem( 'sgaEnabled', 1); console.debug(sessionStorage.getItem('sgaEnabled')) } function disableSGA() { document.getElementById("body").style.fontFamily = "terminess-nf, system-ui"; sessionStorage.removeItem( 'sgaEnabled'); console.debug(sessionStorage.getItem('sgaEnabled')) } function toggleTheme() { // Obtains an array of all // elements. // Select your element using indexing. if (!sessionStorage.getItem('sgaEnabled')) { enableSGA() } else { disableSGA() } }