Removing class from a Div in Javascript
<p>I have a div section </p>

<pre><code>&lt;div class="1"&gt;
        &lt;div id="tab1""&gt;
            &lt;ul class="nav nav-tabs"&gt;                   
                &lt;li class="active ans-tab"&gt; &lt;a href="{$cdn2}"&gt;MyText&lt;/a&gt;&lt;/li&gt;
                &lt;li class="topTab"&gt;&lt;a href="{$cdn2}/Game/"&gt;Game&lt;/a&gt;&lt;/li&gt;
                &lt;li class="topTab"&gt;&lt;a href="{$cdn2}/lb/"&gt;LB&lt;/a&gt;&lt;/li&gt;
            &lt;/ul&gt;
        &lt;/div&gt;
       &lt;div id="tab2"&gt;
        &lt;ul class="nav nav-pills"&gt;
            &lt;li class="active"&gt; &lt;a href="{$cdn2}"&gt;Top&lt;/a&gt;&lt;/li&gt;
            &lt;li&gt;&lt;a href="{$cdn2}/categories/"&gt;Categories&lt;/a&gt;&lt;/li&gt;
        &lt;/ul&gt;
    &lt;/div&gt;
&lt;/div&gt;
</code></pre>

<p>What i am trying to do at each of the pages used as href in the div, is to remove class attribute from the li item which has it as active and assign it to the one, i click. </p>

<p>I have tried removeClass removeAttribute etc but nothing seems to be working for me. I want to use plain Javascript no jQuery</p>

<p>For e.g. my JS code on Game page removes active class from MyText page and add it to Game page's li element.</p>
