Fire tab keypress event in JavaScript?

I don’t think it’s possible; an article about DOM events here …mentions that firing an event doesn’t trigger the default result of the user action, for security reasons; the script should not be able to simulate user interaction directly. You will have to simulate the behavior the keypress causes (such as focus on a field), instead of trying to actually simulate a keypress. You probably won’t be able to interact with the browser’s native autocomplete functionality, unless the browser explicitly provides a means for you to do so.

Edit:

See also: [https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#attr-autocomplete] (Autocomplete HTML attribute)

Leave a Comment