One of today's tasks was to add autocomplete to my project's search bar. So, when you type, a box should appear below the input box to show potential things you might want to search for.
I discovered today the following things:
1 - It's needless to set up an EventListener when you can just use HTML's own properties for it.
2 - OnKeyPress works great for characters and the enter key, but doesn't catch other keys
3 - OnKeyDown can be used to listen for arrow keys, which are returned on the event as such: event.key ==="ArrowUp"
That's all for now~!
When I come up with other, cooler things, I'll be sure to post.
About the author
I'm a Front End Developer in Korea.
I work for a company called Lunit, that develops AI software to diagnose cancer.
From the UK, I came to Korea as an English teacher, and managed to retrain myself, and break out into the programming industry 馃槑
Comments
Join the discussionNo comments yet. Be the first to comment.
