We don't have to limit ourselves to adding or removing entire elements, though—we can fine-tune our jQuery superpowers to alter classes, CSS, and even the contents of our HTML elements.
Let's start with classes. jQuery includes two functions,
.removeClass(), that can be used to add or remove a class from an element. This is great if, for example, you have a
highlighted class that you want to apply to an element when clicked.
The syntax looks like this:
'selector' is the HTML element you want and
'className' is the class name you want to add or remove.
Remember: You aren't selecting anything, you are modifying your element. This means that you do not need
. before your class.