title: How jQuery to change a second select list based on the Third select list option and second select based upon first
body: <p>Why third select option is changing based upon second one. But when first select is selected second one is changing. while go to second third one is not changing
      This is my view.</p>
  
  <pre><code>&lt;select name="select1" select="select1"&gt;
    &lt;option value=""&gt;Select Country&lt;/option&gt;
    &lt;option value="india"&gt;India&lt;/option&gt;
    &lt;option value="america"&gt;America&lt;/option&gt;
  &lt;/select&gt;
  &lt;select name="select2" id="select2"&gt;
    &lt;option value=""&gt;Select State&lt;/option&gt;
    &lt;option data-value="orissa" value="india"&gt;Orissa&lt;/option&gt;
    &lt;option data-value="telangan" value="india"&gt;Telangan&lt;/option&gt;
    &lt;option data-value="america" value="america"&gt;USA&lt;/option&gt;
    &lt;option data-value="america" value="america"&gt;California&lt;/option&gt;
  &lt;/select&gt;
  &lt;select name="select3" id="select3"&gt;
    &lt;option value=""&gt;Select city&lt;/option&gt;
    &lt;option value="orissa"&gt;Nal&lt;/option&gt;
    &lt;option value="orissa"&gt;Mir&lt;/option&gt;
    &lt;option value="Telangan"&gt;Hyd&lt;/option&gt;
    &lt;option value="Telangan"&gt;Vija&lt;/option&gt;
    &lt;option value="america"&gt;KRK&lt;/option&gt;
    &lt;option value="america"&gt;MRK&lt;/option&gt;
  &lt;/select&gt;
  This is my script
  &lt;script&gt;
    $("#select1").change(function() {
      if ($(this).data('options') == undefined) {
        $(this).data('options', $('#select2 option').clone());
      }
      var id = $(this).val();
      var options = $(this).data('options').filter('[value=' + id + ']');
      $('#select2').html(options);
      });
    $("#select2").change(function() {
    if ($(this).data('options') == undefined) {
      $(this).data('options', $('#select3 option').clone());
    }
    var id = $(this).val();
    var options = $(this).data('options').filter('[data-value=' + id + ']');
    $('#select3').html(options);
  });
  &lt;/script&gt;
  </code></pre>