limepot-xyz/public/scripts/galactic-font.js

14 lines
463 B
JavaScript
Raw Normal View History

2024-07-01 14:41:14 -06:00
function toggleTheme() {
// Obtains an array of all <link>
// elements.
// Select your element using indexing.
var theme = document.getElementsByTagName('link')[0];
// Change the value of href attribute
// to change the css sheet.
if (theme.getAttribute('href') == '/css/mystyle.css') {
theme.setAttribute('href', '/css/galactic.css');
} else {
theme.setAttribute('href', '/css/mystyle.css');
}
}