
Lab 19 was about making a search bar that would autofill city and state names based on what the characters the user was typing. In the HTML I created a <form> with an <input>, type set to text, inside, this being the search bar. After styling it in the CSS, I created a JS that was linked to data of cities in the US and their population. A function was created that would look at the letter or string of letters the user typed into the search bar and tried to match it with a similarly sounding city in the US, with more populated cities being at the top of the recommended list.
This type of search bar can be helpful in sites with many webpages. A navigation can only go so far before the user is stuck going page after page just to get to a single destination. If the user knows the name of they page they want to get to, a search bar like this can suggest to the user webpages that sound like what they're looking for. If they user gets the results they desire, they've been saved time and can get to do what they want faster. It creates a more convenient user experience.
Comments
Post a Comment