You could store the previous value in a variable, fetch the current one in your event handler, check if the new one is equal, smaller or greater than the stored one, and if new and stored one are not equal, update the stored one with the new value. Like this:
var oldValue = document.getElementById("myInput").value;
window.addEventListener("load", function() {
document.getElementById("myInput").addEventListener("change", function() {
var newValue = document.getElementById("myInput").value;
if (oldValue == newValue) {
console.log("Value was not changed, current:", newValue); /* this should normally never be the case */
} else if (oldValue < newValue) {
console.log("Value was increased from", oldValue, "to", newValue);
} else if (oldValue > newValue) {
console.log("Value was decreased from", oldValue, "to", newValue);
}
oldValue = newValue;
});
});
<input id="myInput" type="number" value="0">