JSFiddle - React, Tailwind, and code Playground

HTML

<p>Quickly<span onclick="replaceword(this,'Surf','Search');">Search</span>The Web!</p>

JavaScript

function replaceword(that, word, oword) {
    that.textContent = that.textContent == oword ? word : oword;
}