Having some trouble with my main menu on my ASP.NET website. I'm looking to have the selected link change its color to black and stay that way until a different link is clicked.
In simpler terms, I want the selected link to be highlighted.
I've managed to make it work using JavaScript, but the issue is that the style doesn't persist after a page reload (or at least it seems so).
This is my current JavaScript:
<script type="text/javascript">
var last = "none";
function LinkSelector(link) {
if (last != "none") {
document.getElementById(last).className = "NormalLink";
}
document.getElementById(link).className = "ActiveLink";
last = link;
}
</script>
While this script changes the class name when clicked, it doesn't maintain that state upon loading a new page.
Does anyone have a workaround for this? :)
Thank you in advance,
Sincerely,
Bo