You can use "blur" event, wherein when the text value is entered and the event changes from "focus" to "blur", it verifies for validation. Ex:field.addEventListener("blur", validateField); function validateField(e){const text = e.target.value; // Add code for validation & verify.} Reference:https:/...