Code:
<!DOCTYPE html>
<head>
</head>
<body>
<p id="generator">Generate a random fact</p>
<button onclick="myFunction()">Try it</button>
<div id="boldStuff"">
</div>
<script type = "text/javascript">
function myFunction() {
var r_text = [];
r_text[0] = "Give a homeless man a gift card";
r_text[1] = "Hold the door for a stranger";
r_text[2] = "Pay for a stranger's lunch";
r_text[3] = "Compliment the next person you see";
r_text[4] = "Take your neighbor's dog for a walk";
r_text[5] = "Send greeting cards to random addresses";
r_text[6] = "Load a vending machine with money";
var i = Math.floor(7*Math.random())
document.getElementById('boldStuff').innerHTML = r_text[i].toUpperCase();
}
</script>
</div>
</body>
</html>
A small defect is that the same quote may appear twice in succession by random selection. You can overcome this by shuffling your array.
Your uppercase function is quite superflous here.
<script language=javascript> is long deprecated. Use <script type = "text/javascript"> instead (in fact also deprecated but still necessary for IE<9).
The <!-- and //--> comment (hiding) tags have not been necessary since IE3 (i.e. since September 1997). If you see these in some published script it is a warning that you are looking at ancient and perhaps unreliable code.
Quizmaster: Which African country gives its name to the complaint known as 'gippy tummy'?
Contestant: Venezuela.