title: $(this).hide() not working on option elements in IE8
body: <p>I have a problem in my jquery code. I want to make a cascading dropdown using jquery. Below is my code for it.</p>
  
  <p><strong>HTML</strong></p>
  
  <pre><code>&lt;SELECT class="input_style" name="comp_dd" id="comp_dd"&gt;
      &lt;option value="0"&gt;[Select]&lt;/option&gt;
      &lt;OPTION value="1"&gt;Company1&lt;/OPTION&gt; 
      &lt;OPTION value="2"&gt;Company2&lt;/OPTION&gt; 
      &lt;OPTION value="3"&gt;Company3&lt;/OPTION&gt; 
      &lt;OPTION value="4"&gt;Company4&lt;/OPTION&gt; 
  &lt;/SELECT&gt;
  
  &lt;SELECT class="input_style" name="group_dd" id="group_dd"&gt;
      &lt;option data-parent="-1" value="0"&gt;[Select]&lt;/option&gt;
      &lt;OPTION  data-parent="1,3"; value="1" &gt;grp_f&lt;/OPTION&gt; 
      &lt;OPTION  data-parent="1,2"; value="2" &gt;grp_e&lt;/OPTION&gt; 
      &lt;OPTION  data-parent="1,3,4"; value="3" &gt;grp_t&lt;/OPTION&gt; 
  &lt;/SELECT&gt;
  </code></pre>
  
  <p><strong>jquery code</strong></p>
  
  <pre><code>$().ready(function() {  
  
      $('#comp_dd').change(function() {
         var parent = $(this).val();
        if(parent!=0)
        {
         $('#group_dd').children().each(function() {
           var listOfNumbers = $(this).data('parent');        
          if($(this).data('parent')!='-1')
          {   
  
               var numbers = listOfNumbers.split(',');            
               if(jQuery.inArray(parent, numbers)!=-1 )
               {               
                    $(this).show();
              }
              else
              {               
  
                   $(this).hide();
  
              }
          }       
         });
        }
        else
        {
          $('#group_dd').children().each(function() {
               $(this).show();
         });
        }
      });
  });
  </code></pre>
  
  <p>code works correctly into <code>chrome and FF</code> but not working in <code>IE7</code> &amp; <code>IE8</code>. <code>.hide()</code> is not working in <code>IE7 and IE8</code></p>
  
  <p>Please help me to get rid of it.</p>
  
  <p>Thanks in advance</p>
  
  <p><strong>ANSWER:(given by Paulo Rodrigues)</strong></p>
  
  <p>js code:</p>
  
  <pre><code>var original = $('#group_dd').clone();
  
  $('#comp_dd').change(function() {
      var parent = $(this).val();
  
      $('#group_dd').empty().append($(original).html());
  
      if (parent != 0) {
          $('#group_dd').children().each(function() {
              var listOfNumbers = $(this).data('parent');        
              if ($(this).data('parent')!='-1') {
                  var numbers = listOfNumbers.split(',');
  
                  if (jQuery.inArray(parent, numbers)==-1 ) {
                      $(this).remove();
                  }
              }
         });
      }
  });
  </code></pre>