JSFiddle - React, Tailwind, and code Playground

HTML

<div id="something"></div>
<input type="button" onclick="getItem()" value="Click me"/>

JavaScript

var arr = ["foo","bar","baz"];

function getItem(){
    document.getElementById("something").innerHTML = arr[Math.floor(Math.random() * arr.length)];
}