Click the "Try it" button to toggle between adding and removing the "mystyle" class name of the DIV element:
Note: The classList property is not supported in IE9 and earlier. In this example, we check if the browser supports the classList.toggle() method. If not, use the className property together with other JS properties and methods to achieve the same result (for IE9).