It is necessary to call the function after the user enters the text in the text field and moves the mouse away from the field or goes to the next

    1 answer 1

    You need a blur event - a loss of focus element, or onmouseout - "take the mouse away from the field"