I know you can add classes with DOM, but specifically what I want to do is when a link is clicked I want to add a class that will style it as being "active" since a:active only lasts for the moment it is clicked.

Basically I would want something like this:

One of the links will default to "active"

HTML Code:
<a href="#" class="active">Link 1</a> | <a href="#">Link 2</a> | <a href="#">Link 3</a>
Then when another link is clicked the class would be removed from Link 1 and added to the clicked link


HTML Code:
<a href="#">Link 1</a> | <a href="#" class="active">Link 2</a> | <a href="#">Link 3</a>
Hope this makes sense.

Thanks