check when input number value goes up or down
let previous_value;
document.getElementById("input").addEventListener("change", function() {
let value = document.getElementById("input").value;
if (previous_value > value) {
console.log("Decreased");
} else if (previous_value < value) {
console.log("Increased");
}
previous_value = value;
});