JSFiddle - React, Tailwind, and code Playground

HTML

<a href="#">click me and change to text</a>

JavaScript

$(document).on('click','a',function(){
    var $lnk = $(this);
    var $replace = $('<span>');
    $replace.text($lnk.text());
    // Link to Text
    $lnk.replaceWith($replace);
    // Text to Link
    $replace.one('mouseout',function(){
        $replace.replaceWith($lnk);
    });
    return false;
});