I'd like to have input value in my input element change when a user hovers their mouse over the input and scrolls up and down. I've tried adding an onscroll listener to the input but it doesn't seem to do anything. I'd like to use plain JS but am willing to use jQuery. Thanks for the help.
Clarification: I don't want to use the up and down buttons. I want to use be able to hover over the input and then scroll which in change increase or decreases the input value. Perhaps using a container div is needed?
HTML
<input id="my-input" type="number" min="0" max="100" />
CSS
#my-input {
width: 50px;
height: 50px;
}
JS
var myInput = document.getElementById('my-input');
myInput.value = 0;
myInput.onscroll = function(e) {
// this is never printed
console.log('scrolling');
}