Javascript - Filter array results into dropdown list
<p>I have an array as shown below where I want to filter the data and insert the filtered list into a dropdown list.</p>

<p>Here is the data:</p>

<pre><code>{"people":[
    {
      "id":"100",
      "name":"name 1",
      "desc":"desc 1",
      "class": "a"
    },
    {
      "id":"192",
      "name":"name 2",
      "desc":"desc 2",
      "class": "b" 
    },
    {
      "id":"324",
      "name":"name 3",
      "desc":"desc 3",
      "class": "b" 
    },
    {
      "id":"324",
      "name":"name 4",
      "desc":"desc 4",
      "class": "a" 
    },
    {
      "id":"324",
      "name":"name 5",
      "desc":"desc 5",
      "class": "a"
    }
]}
</code></pre>

<p>What I now need to do is to add the array with "class" of "a" and then insert the id's of these into a dropdown list like:</p>

<pre><code>$('#myselect').append($('&lt;option&gt;').text(value.id).attr('value', value.id));
</code></pre>

<p>How can I do this?</p>