what i am trying to do, when i click a tab, the address bar url should also change to that action plus it should also add the class to the anchor tag.
This is very nice example in jsfiddle, that i have seen someone shared on stackoverflow.
but problem here is that it works of adding and removing of class for li tag, but when i change this line
then it only add classes to anchor tag but it dont remove classes from it??
a elements are not siblings in your markup, you should select the siblings of the parent and remove the class from their
a descendant elements.
$(this).addClass("selected") .parent() .siblings() .find('a') .removeClass("selected");