title: Tab View in PHP using Mootools
body: <p>I would like to create a tab view just by hide and show div element with mootools.I am stucked by using mootools and got confused.</p>
  
  <p>Following list generated dynamically from php and we can't guess the element id. When  we are click on each list item; it should apply the active class for the same and remove active class from current list item. </p>
  
  <pre><code>&lt;div class="lorem_ipsum"&gt;
  &lt;div class="lorem"&gt;
      &lt;ul id="main_tabs"&gt;
          &lt;li id="815" class="active" onclick="tabManage()"&gt;Lorem Ipsum&lt;/li&gt;
              &lt;li id="816" onclick="tabManage()"&gt;John&lt;/li&gt;
              &lt;li id="817" onclick="tabManage()"&gt;Lorem Text&lt;/li&gt;
          &lt;li id="818" onclick="tabManage()"&gt;Demo Text&lt;/li&gt;
      &lt;/ul&gt;
  &lt;/div&gt;
  </code></pre>
  
  <p></p>
  
  <pre><code>&lt;script language="javascript"&gt;
   function tabManage()
   {
  
  $('815').addClass = "active";
  
  $('816').removeClass = "active";
  
  $('817').removeClass = "active";
  
  $('818').removeClass = "active";
  }
  &lt;/script&gt;
  </code></pre>
  
  <p>How can we apply a loop in the javascript. Please any body can help me to write javascript script function for same.Thanks in advance</p>