viankakrisna
1/15/2016 - 4:19 PM

toggle class without jQuery

toggle class without jQuery

document.getElementById('menu-button').onclick = function() {
    document.getElementsByTagName('header')[0].classList.toggle('menu-open');
    document.querySelector('div.content').classList.toggle('menu-open');
    document.querySelector('nav').classList.toggle('menu-open');
    return false;
};