apamphilon

Toggle Class on click in jQuery and JavaScript

jQuery:

$('.nav-toggle').on('click', function (){
    $(this).toggleClass('active');
});

javaScript:

var button = document.querySelector('.nav-toggle');
    button.addEventListener('click', function (){
    button.classList.toggle('active');
});

Comments: