I have the default link color active when you enter the site but I can’t seem to get it to remove off active when mouse clicks on another link and the new current page is now active. here is my code.
JS
$("a").on("click", function() {
$(".active").removeClass("active");
});
CSS
.active{
color: #ffff00
!important;
}
a {
text-decoration: none;
z-index: 5;
font-family: arial, "Trebuchet MS";
cursor: pointer;
color: #2777A3;
}
HTML
<a href="http://www.pro.com/" target="_self" class="active">Home</a>`

If you just have HTML, CSS, and JQuery, you just need to set the
activeclass on the right link on each page. You don’t need to remove classes with JQuery.What seems to be happening is that when a user clicks on a link, the page reloads, which resets the CSS and puts the
activeclass on theHomelink again. Every time the user clicks, the page will refresh and reset the class.So, JQuery will effectively remove the class, but then clicking on the link will send the browser to the new page and reset the CSS.
Example:
Home
Other Page 1
Other Page 2