Formatting the Autocomplete Suggestions
Let's style the autocomplete suggestions in this lesson to make them look more like Google's.
We'll cover the following...
In this lesson, we’ll address any outstanding functionality that relies on JavaScript.
Outstanding Functionality
- Using a template for the suggestion and auxiliary data.
- We need to insert it between
<li>
elements, so it conforms to regular HTML inside a<ul>
, which is where we’re inserting these suggestions.
- We need to insert it between
- Determine which sections need to be bolded
- Using a comparison between the input value and the given suggestion
- Add classes to elements as necessary for them to change their styles dynamically
- The buttons look like they merge