title: Best way to get a list of locations in a select drop down list with options
body: <p>Ok so first I am sorry if this question has been asked I searched on here for something similar but couldn't find exactly what I am looking for. So what I am trying to do is get a list of locations in a drop down list so users can choose there location and view content based on there location. I want all provinces and cities within each province(This is canada only).</p>
  
  <p>So my current idea is to manually type each province and major cities within each province just a small ex:</p>
  
  <pre><code>&lt;select placeholder='location'&gt;
      &lt;optgroup label='New Brunswick'&gt;
          &lt;option value='all_new_brunswick'&gt;All of New Brunswick&lt;/option&gt;
          &lt;option value='moncton'&gt;Moncton&lt;/option&gt;
          etc...
      &lt;/optgroup&gt;
      &lt;optgroup label='Alberta'&gt;
         &lt;option value='all_alberta'&gt;All of Alberta&lt;/option&gt;
         &lt;option value='calgary'&gt;Calgary&lt;/option&gt; 
         etc..
      &lt;/optgroup&gt; 
  &lt;/select&gt;
  </code></pre>
  
  <p>So I type each province then within each province I add a list of major cities(high populations) only. While typing all this out I realized how much work just adding the major cities is. and I am thinking what a user will think if there city is not listed. So Is there a better way to go at it? I really don't want to spend money on an API(not much free apis to get a users location also not always accurate as getting a user to choose themselves).</p>
  
  <p>My other idea is if there is a free geolocation where I can fetch a users location then add that to a database every time someone with a new location signs on to my site. Then use that data to display in a drop down list and a user can choose the location they want to search in(if they don't want to search there city).</p>
  
  <p>Anyone that can shed some light on this would be greatly appreciated!</p>