1

How can I do this? I basically want to call a function where I get the info from the textbox once the user is done entering info. I.e., after they click off of the text box. I couldn't find the clear way to do this. Is there an API for event/actions and what you can do on each input?

1 Answer 1

1

Try the blur event:

yourTextBox.onblur = function() {
    console.log(yourTextBox.value);
};

or

yourTextBox.addEventListener('blur', function() {
    console.log(yourTextBox.value);
});

See the documentation for the blur event on MDN here.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.