Basically a toggle. I have this button:
<button id='btn'>Hover, don't click</button>
And this js:
function changeColor () {
document.getElementById('btn').style.color = 'red';
}
Now:
document.getElementById('btn').addEventListener('mouseover', changeColor);
Worked as commanded, but:
document.getElementById('btn').removeEventListener('mouseout', changeColor);
Disobedient. JS Fiddle thought all are behaving correctly: http://jsfiddle.net/jimges/roq9x1os/
I disagree. Thanks!