JSFiddle - React, Tailwind, and code Playground

by hesster92

HTML

<html>

<body>


<h1>Assignment 1</h1>

<button type="button" onclick="names()">Pick One</button>

<p id="pick"></p>


</body>
</html>

JavaScript

var list = ["Aren", "Christopher", "Austin", "Eugene", "Jason", "Jeff", "Mina", "Patrick", "Clarence", "Mark", "Scot"];


function names() {
  var choose = Math.floor(Math.random() * (list.length));
  document.getElementById('pick').innerHTML = list[choose];
}