title: jquery change display mode
body: <p>I have the following html file containing some bunch of div elements each having id and class. I created tabs and page assigned to each tab. The problem is looping through each parent div to set the display of the children div to a different class and make the clicked tab change it's background.</p>
  
  <p>I tried the following :</p>
  
  <pre><code> function MakeActiveTab(CurrentPage, CurrentTab)
    {
      $('#PageID').children().filter(".pageParagraph").css('display','none');
      $('#PageID').children().filter("#" + CurrentPage).css('display', 'block');
      $('#Mainmenu').children().filter(".TabClass").css('background', '#fff');
      $('#Mainmenu').children().filter("#" + CurrentTab).css('background', '#007700;');
    }
  </code></pre>
  
  <p>but it doesn't work!  any idea is appreciated.</p>
  
  <pre><code> &lt;div id='Mainmenu'&gt;
     &lt;div id='menu1' class='TabClass'&gt;
      Tab1
     &lt;/div&gt;
     &lt;div id='menu2' class='TabClass'&gt;
      Tab2
     &lt;/div&gt;
  
    &lt;/div&gt;
  
   &lt;div id='PageID'&gt;
         &lt;div id='page1' class='pageParagraph'&gt;
           some content
         &lt;/div&gt;
  
         &lt;div id='page2' class='pageParagraph'&gt;
           some content
         &lt;/div&gt;
   &lt;/div&gt;
  </code></pre>
  
  <p>I created a javascript function creating pages and menus dynamically into their parent div. That's working fine except I can't get current Tab. When I did that with javascript, it worked but not on IE8.</p>