Welcome to the Treehouse Community
Looking to learn something new?
Sharanya Venkat7,222 Points
class="selected" on nav a
How does every navigation a tag get the .selected class when it is applied only on the portfolio tag
Bertan Ulusoy18,047 Points
Hi, I think, this can be achieved with jQuery's addClass and removeClass functions. When a user clicks any navigation link in your app, you can remove .selected class from all, and after that add .selected class which link is selected by the user. So the color will change.
Question: How can I understand which link is clicked? Add (unique) "id" attribute to all of your links and in your (a href) click event function, get id attribute's value to check which link is clicked. (like --> var Id = $(selector).attr("id"); )