xxxxxxxxxx
<html>
<head>
<script>
// define an array of quotes
var quotes = [
"quote 1",
"quote 2",
"quote 3"
];
// function to select a random quote from the array
function getRandomQuote() {
var randomIndex = Math.floor(Math.random() * quotes.length);
return quotes[randomIndex];
}
// function to display the quote on the page
function displayQuote() {
var quote = getRandomQuote();
document.getElementById("quoteDisplay").innerHTML = quote;
}
</script>
</head>
<body>
<div id="quoteDisplay"></div>
<button onclick="displayQuote()">Show Quote</button>
</body>
</html>