title: Filter JSON based on selected dropdown option
body: <p>I have a JSON file with a list of countries which has 2 keys: "name" and "areacode". I have dropdown with a list of options that has a value attr witch is the same as the "name" key in the JSON file.</p>
  
  <p>Long story short: I want to display the "areacode" value in the json file when the selected option in the dropdown matches the "name" value in the JSON file</p>
  
  <p><a href="https://i.stack.imgur.com/0wbTQ.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/0wbTQ.png" alt="Screenshot"></a></p>
  
  <p><strong>UPDATE</strong></p>
  
  <p>I have pasted the code here: <a href="http://codepen.io/sarfehjou/pen/RpKMWE" rel="nofollow noreferrer">http://codepen.io/sarfehjou/pen/RpKMWE</a></p>
  
  <p>The only difference is that in my solution I have to get the JSON file by a url</p>
  
  <p><strong>HTML</strong></p>
  
  <pre><code>  &lt;select&gt;
     &lt;option value="Afghanistan GLOBAL"&gt;Afghanistan GLOBAL&lt;/option&gt;
     &lt;option value="Albenter code hereania"&gt;Albania&lt;/option&gt;
     &lt;option value="Algeria"&gt;Algeria&lt;/option&gt;
     &lt;option value="American Samoa"&gt;American Samoa&lt;/option&gt;
     &lt;option value="Andorra"&gt;Andorra&lt;/option&gt;
   &lt;/select&gt; 
  </code></pre>
  
  <p><strong>Script</strong></p>
  
  <pre><code>    var list = {
      "countries": [
          {
              "name": "Afghanistan GLOBAL",
              "areacode": ""
          },
          {
              "name": "Albania",
              "areacode": ""
          },
          {
              "name": "Algeria",
              "areacode": ""
          },
          {
              "name": "American Samoa",
              "areacode": ""
          },
          {
              "name": "Andorra",
              "areacode": ""
          }
        ]
      }
  </code></pre>