JSFiddle - React, Tailwind, and code Playground
HTML
<input type="button" onclick="randomURL()" value="Generate"></input>
<input placeholder="Press the button!" id="textField" type="text"></input>
JavaScript
function randomURL() {
var randy = Math.floor(Math.random()*1000)+1;
var textField = document.getElementById("textField");
textField.value = randy;
}