1document.getElementById('myButton').onclick = function() {
2 this.classList.toggle('active');
3}
1var menu = document.querySelector('.menu') // Using a class instead, see note below.
2menu.classList.toggle('hidden-phone');
1onClick() {
2 alert("clicked");
3 $('.'+ styles.transform ).toggleClass(styles.transform-active);
4 }
1document.getElementById('myButton').onclick = function() {
2
3 var className = ' ' + myButton.className + ' ';
4
5 if ( ~className.indexOf(' active ') ) {
6 this.className = className.replace(' active ', ' ');
7 } else {
8 this.className += ' active';
9 }
10}