Skip to content

Instantly share code, notes, and snippets.

@ncesar
Created January 28, 2019 20:32
Show Gist options
  • Save ncesar/fd00fa6803f27c265f8f04046b535743 to your computer and use it in GitHub Desktop.
Save ncesar/fd00fa6803f27c265f8f04046b535743 to your computer and use it in GitHub Desktop.
This code adds a .active class on a menu, then removes.
$('.menu li').click(function() {
$('.menu li.active').removeClass('active');
$(this).addClass('active');
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment