JSFiddle - React, Tailwind, and code Playground

HTML

<button onclick="selectCategory('Category Hello', 'demo')">Button 1 (Hello)</button>
<button onclick="selectCategory('Category World', 'demo')">Button 2 (World)</button>

<div id="demo">Select Category</div>

<!-- This is to show how you can change the result location -->
<br>
<button onclick="selectCategory('Category Other', 'anotherResultLocation')">Button 3 (Other)</button>
<div id="anotherResultLocation"></div>

JavaScript

function selectCategory(category, results) {
  var postResults = document.getElementById(results);
  postResults.innerHTML = category;
}