Chances are if you are using Jquery, you will have come across a situation where you want the element you click on to take on a certain class and you want this class to be removed from all other elements.
This is really quite simple. All you need to do is add the class to the element you click on using
this and remove it from all other elements of the same class name or any other selector you choose to use.
See code and pen below!