input field check if value decreases or increases code example
Example: 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;
});