Coding task · JavaScript and TypeScript course · Module 8: Events and the DOM
Exercise: Search Autocomplete
Create an autocomplete system for the dinosaur search engine.
Task
The index.html file has a #dino-search field and a #suggestions list, and the script has an array of dinosaur species. Fill in the blanks: ___BLANK1___ is the event the field sends after every change of the typed text, and ___BLANK2___ is the string method that checks whether a name starts with the typed fragment. After typing "tri" the list should show only Triceratops (letter case does not matter), an empty field and text with no matches clear the list, and clicking a suggestion puts it in the field.