JSFiddle - React, Tailwind, and code Playground

HTML

<p>Click the button to swap the text of the DIV element:</p>

<p>
  <button onclick="myFunction(this)" value="a">
    Category A
  </button>
  <button onclick="myFunction(this)" value="b">
    Category B
  </button>
</p>

<div id="myDIV">Hello</div>

JavaScript

function myFunction(myEle) {
  var x = document.getElementById("myDIV");
  x.innerHTML = "This is category " + myEle.value;
}