Toggle between adding and removing a class name from an element with JavaScript.
Read on how to do it in this tutorial: https://www.w3schools.com/howto/howto_js_toggle_class.asp
Try it yourself here: https://www.w3schools.com/howto/tryit.asp?filename=tryhow_js_toggle_class
Tip: Also see How To Add A Class.
Tip: Also see How To Remove A Class.
Tip: Learn more about the classList property in our JavaScript Reference.