Forms have specific events for user input:
form.addEventListener("submit", handleSubmit);
input.addEventListener("input", (e) => {
// Fires on every change
console.log(e.target.value);
});
input.addEventListener("change", (e) => {
// Fires when field loses focus
});
input fires immediately. change fires when the user leaves the field.