Markup
<input type="checkbox" id="flexSwitchCheckDefault" onclick="darkLightMode(this)" />
JavaScript
<script type="text/javascript">
function darkLightMode(element) {
(element.checked) ? document.body.classList.add('dark-mode') : document.body.classList.remove('dark-mode');
}
</script>
No comments:
Post a Comment