What is the distance?

In this approach, I have the user input city names and states that I use to make an ajax request to an api that will respond with the zipcodes for each city. I then handle the response with gathering the first zip code of each city. I then run one final ajax request with the zip codes that will respond with an approximate distance between the two locations in miles. I then run a function places the distance in the document.

Enter a location by city name.