JSFiddle - React, Tailwind, and code Playground

by chris richarde

HTML

<input type="button" id="blue" value="pick one" onClick="pickMyArray();" />
<br/>
<div id="output">
  Hello Dr Eaglin! Please press the button to select student for automatic A for this class.
</div>

JavaScript

//can't seem to get this to work. Up top the buttton is set and onclick is calling the function. 

// myArray is set globally
 var myArray= [Kristopher, Ignacio, Vanessa, Charlene, Casey, Christian, Adnane,
    Nicholas, Ronald, Andrew];

function pickMyArray() 
{//random is set to randomly pick from myArray given its array length.
	var random = myArray[Math.floor(Math.random() * myArray.length)];
//this gets random variable and assigns it to output
random=document.getElementById("output").innerHTML;
}