<div id="content-container">
<ul>
<li id="link1"><a href="http://mysite/ClassifiedPrograms/Pages/Training1.aspx">Training1</a></li>
<li id="link2" ><a href="http://mysite/ClassifiedPrograms/Pages/Training2.aspx">Training2</a></li>
<li id="link3" ><a href="http://mysite/ClassifiedPrograms/Pages/Training3.aspx">Training3</a></li>
<li id="link4" ><a href="http://mysite/ClassifiedPrograms/Pages/Training4.aspx">Training4</a></li>
</ul>
</div>
When any link is clicked, onclick of that link should change the parent li id and make it clickedlink1 if link1 was clicked. How do i do that in jquery?
Changing the class of the
liwhen the link is clicked will not necessarily help here as that will reset as soon as the new page loads.You could instead use this:
Which will add the class “is_visited” to any
liwhere the link has been visited.