Quantcast
Viewing all articles
Browse latest Browse all 37

jQuery, navigation-like styled links [closed]

Take a look at the grey StackOverflow links at the top of this page. The ones that are to the right of the logo. They say "Questions", "Tags", "Users", "Badges", and "Unanswered". Notice how the "Questions" link is orange because you are viewing my question.

I have 5 links that, when clicked, do jQuery things. They do not redirect you to another page.

<a class="english"></a><a class="science"></a><a class="languages"></a>[ect.]

All I want is to add a selected class to the link I click. And then once I click another link, to remove the original selected class of the first link and add it to the new link I clicked.

For example, If I click <a class="english"></a>, add selected class to it.

Then when I click <a class="science"></a>, remove the selected class from <a class="english"></a> and add the selected class to <a class="science"></a>.

Thanks in advance! :]


Viewing all articles
Browse latest Browse all 37

Trending Articles