Website with 3 randomly picked statements from list

Associate
Joined
18 Jul 2004
Posts
1,866
Im trying to create a website for my company. We'd like to have a site which we display 3 statements from a list of around 20. How would I go about doing this?
 
How are you storing your 20 statements? What language do you want to use to retrieve them?

Im quite new to this so the easiest way would be best, im not sure what this is? I thought it would be possible to store them in the code and only display 3 of them randomly on the page?
 
So I tried to implement that:

Code:
<html>
<head>
<title>test</title>
<script type="text/javascript">

var statements = [
	'test1',
	'test2',
	'test3',
];

function getRandomStatement() {
	return statements[Math.floor(Math.random() * statements.length)];
}

document.getElementByID('foo').innerText = getRandomStatement();

</script>
<body bgcolor="#FFFF00">
<h1 style="text-align: center;">
<span style="color:#000000;">
<span style="font-family: 'lucida sans unicode', 'lucida grande', sans-serif;">
<span style="font-size: 36px;">
<span style="line-height: 16px;">
<span style="background-color:#ffff00;">
<div id="foo"></div>
</span>
</span>
</span>
</span>
</span>
</h1>
</body>
</html>

But it doesnt display anything on my site. I think I must be being a total noob here.
 
Back
Top Bottom