JSFiddle - React, Tailwind, and code Playground
HTML
<input type="button" id="btnSearch" value="Search" onclick="GetValue();" />
<p id="message" >ddd</p>
JavaScript
function GetValue()
{
var myarray= new Array("item1","item2","item3");
var random = myarray[Math.floor(Math.random() * myarray.length)];
document.getElementById("message").innerHTML=random;
}