title: Jquery even odd selectors not working for dynamic content
body: <p>After I change content by moving elements around, I want to re-apply <code>odd</code> and <code>even</code> styles for them. But in this specific example, it's not working. Unfortunately I can't use CSS for :even and :odd selectors (not supported in IE 8). Please help.</p>
  
  <p><a href="http://jsfiddle.net/rghg3j5v/" rel="nofollow">http://jsfiddle.net/rghg3j5v/</a></p>
  
  <pre><code>function highlightRows() {
      $('table tr:odd td').addClass('odd');
      $('table tr:even td').addClass('even');
  }
  
  highlightRows(); // Initial styling
  
  $('.up').click(function() {
      var parent = $(this).parents('tr');
      var prev = $(parent).prev();
  
      $(parent).insertBefore(prev);
      highlightRows(); // Re-apply style when element is moved
  });
  
  $('.down').click(function() {
      var parent = $(this).parents('tr');
      var next = $(parent).next();
  
      $(parent).insertAfter(next);
      highlightRows(); // Re-apply style when element is moved
  });
  </code></pre>