Lab #19 Type Ahead

Lab #19 is titled "Type Ahead". This lab consists of creating a search bar that allows you to find the population of any city or state in the United States. In the screenshot below, you can see I typed in New York and got a bunch of suggestions as well as population numbers. I highlighted the population number of New York as a demonstration that the search bar works.


To make this search bar function, I used some HTML, a lot of JavaScript and a handful of CSS. The only thing in my HTML document itself was a form that I gave it a class named "search-form". I also added an input with it so that users could type in it because it wouldn't be a search bar if they couldn't search anything. Within my CSS, I set up the format for what the results would look like after a user has typed something. Lastly, the JavaScript had been linked to data on the population of every city and state in the United States, so all of the data given on this page is based on that data. It may not be 100% accurate but it's a good estimate. The JavaScript also functions the search bar mechanic so when you type something in it, there is a function that displays the matches based on what you typed.

Web designers could find this search bar mechanic useful for allowing users to comfortably navigate through their page and find what they are looking for. This type of navigation would be best used on an information website where users want to find out some type of data like news, etc. What do you think google is? It's a search engine. Hey, if you want to be the next Google, why wait?

Comments

Popular posts from this blog

WBL Workshop #6 Interview Skills

CTE Expo Reflection Journal

Lab #12 Reflection