JSFiddle - React, Tailwind, and code Playground

by jay dowling

HTML

<p>Click the button to fill and array with random numbers of 1 thru 100.</p>
<p><button onclick="InsertIntoArray()">Generate</button></p>
<p id="genNumber"></p>

JavaScript

function insertIntoArray() {
    
    
     x.innerHTML = Math.floor((Math.random() * 100) + 1);

    var x = document.getElementById("genNumber")
    }