The classList property is not supported in Internet Explorer 9 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).
Click the button to toggle between adding and removing the class "mystyle" from the DIV element.