title: Use jQuery to show second field based on the first select list option
body: <p>When I select multiple fields from the first selection box (Animal &amp; Bird) the second selection box shows the first field I selected. </p>
  
  <p>It works fine if I select from the first selection box and i get the correct output on the second selection box. </p>
  
  <p>But, when I select multiple field on the first selection box, the output on the Second Selection box doesn't show all the output based on the first selection box.</p>
  
  <p>Below is my code please help me:</p>
  
  <p><div class="snippet" data-lang="js" data-hide="false">
  <div class="snippet-code">
  <pre class="snippet-code-js lang-js prettyprint-override"><code>$("#select1").change(function() {
    if ($(this).data('options') == undefined) {
      /*Taking an array of all options-2 and kind of embedding it on the select1*/
      $(this).data('options', $('#select2 option').clone());
    }
    var id = $(this).val();
    var options = $(this).data('options').filter('[value=' + id + ']');
    $('#select2').html(options);
  });</code></pre>
  <pre class="snippet-code-html lang-html prettyprint-override"><code>&lt;script src="//ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"&gt;&lt;/script&gt;
  
  &lt;select name="select1" id="select1" size="4" multiple&gt;
    &lt;option value="1"&gt;Fruit&lt;/option&gt;
    &lt;option value="2"&gt;Animal&lt;/option&gt;
    &lt;option value="3"&gt;Bird&lt;/option&gt;
    &lt;option value="4"&gt;Car&lt;/option&gt;
  &lt;/select&gt;
  
  &lt;select name="select2" id="select2" size="4" multiple&gt;
    &lt;option value="1"&gt;Banana&lt;/option&gt;
    &lt;option value="1"&gt;Apple&lt;/option&gt;
    &lt;option value="1"&gt;Orange&lt;/option&gt;
    &lt;option value="2"&gt;Wolf&lt;/option&gt;
    &lt;option value="2"&gt;Fox&lt;/option&gt;
    &lt;option value="2"&gt;Bear&lt;/option&gt;
    &lt;option value="3"&gt;Eagle&lt;/option&gt;
    &lt;option value="3"&gt;Hawk&lt;/option&gt;
    &lt;option value="4"&gt;BWM&lt;option&gt;
  &lt;/select&gt;</code></pre>
  </div>
  </div>
  </p>