JSFiddle - React, Tailwind, and code Playground

by David Thomas

HTML

<a href="#" data-switch="a">Some link text</a>

JavaScript

$('a').click(function(e){
    e.preventDefault();
    var that = $(this);
    switch (that.data('switch')){
        case 'a':
            console.log('Function one');
            that.data('switch','b');
            break;
        case 'b':
            console.log('Function two');
            that.data('switch','a');
            break;
    }
});