paullacey78
8/21/2018 - 10:19 AM

JS simple toggle

function classToggle() {
    this.classList.toggle('class1');
    this.classList.toggle('class2');
}
document.querySelector('#div').addEventListener('click', classToggle);