It seems like using the input
event on a type=range
input element works differently in Webkit and Firefox. I really don't understand why the event fires both on sliding the slider and while releasing the mouse.
I very much do not want the event to fire again when releasing the mouse button.
Any ideas how to stop this mouseup
nonsense with the input event?
var counter = document.querySelector('div'),
rangeInput = document.querySelector('input');
rangeInput.addEventListener('input', function(){
counter.innerHTML = 1 + +counter.innerHTML;
});
body{ font:18px Arial; }
input{ width:80%; }
div{ color:red; }
div::before{ content:'Event fired: '; color:#555; }
div::after{ content:' times'; color:#555; }
<p>Try to click the slider, wait and release the mouse</p>
<input type="range" min="1" max="100" step="1">
<div>0</div>