Suppose I want to dynamically via javascript or jquery change the class of the following to class="active" How do I achieve it?
<!-- Navigator -->
<div style="position: abolute; top: 50px" class="navbar navbar-fixed-top">
<div class="navbar-inner">
<div class="container">
<ul id="yw0" class="nav">
<li class="active"><a href="#" style="color: black">Company</a></li>
<li><a href="#" style="color: black" class="link"><i class="fa fa-lightbulb-o"></i> FAQs</a></li>
<li><a href="#" style="color: black" class="link"><i class="fa fa-question-circle"></i> Help Center</a></li>
<li><a href="#" style="color: black"><i class="fa fa-newspaper-o"></i> Press</a></li>
<li><a href="#" style="color: black">Careers</a></li>
<li><a href="#" style="color: black" href="#"><i class="fa fa-envelope-o"></i> Contact Us</a></li>
</ul>
</div>
</div>
</div>
I want to actually know how can I change the class of the li tag?
<li class="active">
I know that there is a method that I can use http://api.jquery.com/addclass/ But how do I do it with my example above.