I have been looking all around the internet and I can not a solution to my problem.
I have an input field called Destination. When a user starts typing the city name, a suggestion dropdown appears that gives the user suggestions if he/she is searching for that specific city.
I added an addEventListener("input", broji); to the input field so that a action happens when a user types 3 characters in the input field.
Here is the code:
function broji(){
if(from.value.length == 3){
console.log("three characters")
//fire TAB click, so that it autofills the
// input field.
}
}
from.addEventListener("input", broji);
So right now, every time when a user types three characters in the input field, I get "three characters" result in the console.
The only thing that I need now is to find out how can I fire a keypress for the TAB key when a user types three characters in the input field?
Thank you once again!