JSFiddle - React, Tailwind, and code Playground

HTML

<button onclick="myFunction()">Try it</button>

<p id="demo">Please visit blog!</p>

JavaScript

window.myFunction = function() {
  var str = document.getElementById("demo").innerHTML; 
    var txt = str.replace("blog","javascripttech");
    document.getElementById("demo").innerHTML = txt;
}