I have a div section
<div class="1">
<div id="tab1"">
<ul class="nav nav-tabs">
<li class="active ans-tab"> <a href="{$cdn2}">MyText</a></li>
<li class="topTab"><a href="{$cdn2}/Game/">Game</a></li>
<li class="topTab"><a href="{$cdn2}/lb/">LB</a></li>
</ul>
</div>
<div id="tab2">
<ul class="nav nav-pills">
<li class="active"> <a href="{$cdn2}">Top</a></li>
<li><a href="{$cdn2}/categories/">Categories</a></li>
</ul>
</div>
</div>
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.
I have tried removeClass removeAttribute etc but nothing seems to be working for me. I want to use plain Javascript no jQuery
For e.g. my JS code on Game page removes active class from MyText page and add it to Game page's li element.