JSFiddle - React, Tailwind, and code Playground

by David Thomas

HTML

<div class="test">Text1<span></span></div>

JavaScript

$('.test').click(
    function() {
        this.firstChild.nodeValue = 'Text2';
    });