We can switch between adding and removing classes using the toggle class method to see how it works.
Simply replace the removed class method with toggle class.
And this is in the file from our last lesson
and just update the label on your button from remove to toggle.
Class Notes save the file and when you refresh the page
you can see that we can use the same button to trigger an add class and remove class event.