JSFiddle - React, Tailwind, and code Playground
by j08691
HTML
<span class="js-textEdit" data-text="Show less">Show more</span>
CSS
span {
color: #18c;
cursor: pointer;
}
span:hover {
text-decoration: underline;
}
JavaScript
$('.js-textEdit').click(function () {
var oldText = $(this).text();
var newText = $(this).data('text');
$(this).text(newText).data('text',oldText);
});