MS Edge transition test

In MS Edge, if you click on the button two times quickly, it will say "Off", but still do the transition to 0.1 opacity. This seems to be buggy behavior of Edge.

by winstonchang

HTML

<button id ="b">Off</button>

CSS

button {
  font-size: 1.5em;
  width: 12em;
  height: 4em;
/*  opacity: 1; */
}

.on {
  opacity: 0.1;
  transition: opacity 1s ease 0.5s
}

JavaScript

document.getElementById("b").addEventListener(
  "click",
  function() {
  	if (this.className === "on") {
    	this.innerHTML = "Off";
    	this.className = "";
    } else {
    	this.innerHTML = "On";
  	  this.className = "on";
    }
  }
);