<input type="button" id="btnSearch" value="Search" onclick="myFunction();" />
<div id="message">
<p></p>
</div>
<br>
<div id="message">
<p></p>
</div>
<script type="text/javascript">
function myFunction() {
var myarray= new Array ("Drama", "Fable", "Fairy Tale", "Fantasy", "Fiction", "Folklore", "Historical Fiction", "Horror", "Humor", "Mystery", "Mythology", "Poetry", "Realistic Fiction", "Science Fiction", "Short Story", "Tall Tale");
var random1 = myarray[Math.round(Math.random() * (myarray.length - 1))];
var random2 = myarray[Math.round(Math.random() * (myarray.length - 1))];
var display = document.getElementById("message").innerHTML = random1 + ", " + random2;
}
</script>
I have this script set up and I'm aiming to show two randomly selected words from my array next to each other when the button is clicked. Any assistance will be greatly appreciated!