My CTA is set up like this:
<div class="heading__link">
<a class="heading__cta" href="#about">View my work</a>
</div>
Additionally, my navigation bar is structured like this:
<nav id="nav-bar" class="nav-bar">
<ul class="nav">
<li class="nav__item"><a class="nav__link" href="#home">Home</a></li>
<li class="nav__item"><a class="nav__link" href="#about">About</a></li>
<li class="nav__item"><a class="nav__link" href="#projects">Projects</a></li>
<li class="nav__item"><a class="nav__link" href="#contact">Contact</a></li>
</ul>
</nav>
I am currently trying to implement a feature that highlights the 'about' link in the navigation bar when I click on the CTA. However, I am having difficulty achieving this with JavaScript. My goal is for the 'about' link to remain highlighted until another link is clicked.
I believe adding an .active class could potentially solve this issue, but I am struggling to make it work specifically with a CTA.