JSFiddle - React, Tailwind, and code Playground

by dystroy

HTML

<p>Fruit <span class="unc_path">\\apples\oranges\pears</span></p>

JavaScript

$('.unc_path').click(function (){
    var text = $(this).text();
    var $this = $(this);
    var $input = $('<input type=text>');
    $input.prop('value', text);
    $input.appendTo($this.parent());
    $input.focus();
    $input.select();
    $this.hide();
    $input.focusout(function(){
        $this.show();
        $input.remove();
    });
});