JSFiddle - React, Tailwind, and code Playground

by Alexey Zuev

HTML

<a href="#">one</a>
<a href="#">two</a>
<a href="#">three</a>

CSS

.active { color: blue;}

JavaScript

$(function() {
    var clickedItem;
    
    $('a').bind('click', func);

    function func() {
        $(this).addClass('active').unbind('click');

        clickedItem && clickedItem.bind('click', func).removeClass('active');

        clickedItem = $(this);
    }
});