Created
December 3, 2013 18:02
-
-
Save enopanen/7774227 to your computer and use it in GitHub Desktop.
Adding and removing CSS classes on HTML elements is another fairly common action. This is one technique you may consider with selected menu items, highlighted rows, or active input elements. This newer method is simply quicker than using .addClass() and .removeClass() where you can put all the code into one function call.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$('nav a').toggleClass('selected'); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment