I try to set active the element of my navbar when I click on the button.

My navbar is like that: 

![navbar](https://i.stack.imgur.com/tSwo9.png)

But when I click on the "a" for exemple, the "G" remains active.

My code is like that: 

```
<div class="navbar span8" id="navbar">
    <div class="navbar-inner">
        <ul class="nav">
             <li><a href="#a">A</a></li>
             <li><a href="#b">B</a></li>
             <li><a href="#c">C</a></li>
             <li><a href="#d">D</a></li>
             <li><a href="#e">E</a></li>
             <li><a href="#f">F</a></li>    
              .....         
       </ul>
    </div>
</div>

```

To set a class active the code is: 

```
 <li class="active"><a href="#f">F</a></li>

```

How can I do that with jQuery?