I created a button that generates random text in JavaScript. I would like to style the randomly generated text to be below the button, centered, and have the following color: #8a2be2.
<!-- arrays -->
function GetValue()
{
var myarray= new Array();
myarray[0]="The calcium in our bones and the iron in our blood come from ancient explosions of giant stars."
myarray[1]="The Chinese giant salamander can grow to be 6 feet (1.8 m) long, making it the largest salamander in the world."
<!--END-->
var random = myarray[Math.floor(Math.random() * myarray.length)];
//alert(random);
document.getElementById("fact button").innerHTML=random;
}
<input type="button" id="fact_button" value="Fact Button" onclick="GetValue();" />
<p id="fact button" ></p>
<h2 class="h2">click fact button for an amazing fact!</class> </h2>