turn class on off class in javascript code example
Example: classname toggle js
document.getElementById('myButton').onclick = function() {
this.classList.toggle('active');
}
document.getElementById('myButton').onclick = function() {
this.classList.toggle('active');
}