Skip to content

Instantly share code, notes, and snippets.

@aresnick
Last active September 13, 2020 03:33
Show Gist options
  • Save aresnick/2e28a2b377a832071c748e500a0ee967 to your computer and use it in GitHub Desktop.
Save aresnick/2e28a2b377a832071c748e500a0ee967 to your computer and use it in GitHub Desktop.
document.addEventListener("DOMContentLoaded", function(){
document.querySelector('.tz-switcher').addEventListener('change',function() {
var getText = document.querySelector('.tz-switcher option:checked').innerHTML;
document.querySelector('body').classList.remove( ...document.querySelector('body').classList);
document.querySelector('body').classList.toggle("tz-" + getText);
});
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment