The method toggleClass() alternates between adding and removing the specified classes to the selected elements.
This method checks each element for the specified class names. The class names are added if missing, and removed if already set.
The following code create a toggle effect in your webpage. This method takes one or more class names as its parameter.
The above code would remove a class with one click and in second click it would again add the same class. As with the other methods, multiple class names can be provided, separated by a space.
This is a paragraph