Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
/* jQuery */
element.addClass('color-main');
element.removeClass('color-main');
element.toggleClass('color-main');
element.hasClass('color-main');
/* JavaScript */
element.classList.add('color-main');
element.classList.remove('color-main');
element.classList.toggle('color-main');
element.classList.contains('color-main');
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment