Array Example
by dhizzybusy
HTML
<!DOCTYPE html>
<html>
<body>
<p>Click the button to get random first name.</p>
<input type="button" id="btnSearch" value="Pick One" onclick="GetValue();" />
<p id="message" ></p>
<script>
function GetValue()
{
var lStudents = new Array ("Cheyenne","Luis","Connor","Amanda","Jonathon","Marc","Miguel","Jaqueline","Marcus","Davy");
var random = lStudents[Math.floor(Math.random() * lStudents.length)];
document.getElementById("message").innerHTML=random;
}
</script>
</body>
</html>