Make javascript run onclick instead of pageload
<p>I have the the following script that runs when the page is loaded:</p>

<pre><code>&lt;script language="JavaScript"&gt; 
     j=parseInt(Math.random()*ranobjList.length);
     j=(isNaN(j))?0:j;
     document.write(unescape(ranobjList[j]));
&lt;/script&gt;
</code></pre>

<p>How can I execute it when a button is clicked rather then when it loads?</p>
