JSFiddle - React, Tailwind, and code Playground

HTML

<a class="active" href="#">something</a>

<a class="common active" href="#">something</a>

CSS

.active {
    border: 1px solid red;
}

.inactive {
    border: none;
}

JavaScript

$(".active").click(function(){
    $(this).toggleClass("active","inactive");
});
$(".inactive").click(function(){
    $(this).toggleClass("inactive","active");
});

$(".common").click(function(){
    $(this).toggleClass("inactive","active");
});