<ul class="menu">
  <li><a href="javascript:;">Раз</a></li>
  <li><a href="javascript:;">Два</a></li>
  <li><a href="javascript:;">Три</a></li>
</ul>
.active{
  color: #fff;
  background: red;
}
$(function(){
  $("a").on("click",function(){
    $(".menu a").each(function(){
      $(this).removeClass("active");
    });
    $(this).addClass("active");
  });
});

External CSS

This Pen doesn't use any external CSS resources.

External JavaScript

  1. https://cdnjs.cloudflare.com/ajax/libs/jquery/3.5.1/jquery.min.js