var newurls=new Array()
location.href = newurls[num]
<h2>A Random URL</h2>
<input type="button" value="Click to go to a Random Site" onClick="picksite()">
Gives you this...
The effect can be done by offering links as array items. Then the script is run as a function when the button is clicked. You could have also written it so that the button was literally built through the script.