Hello, how can I put an onload in the script itself, instead of in the body. So that this <BODY onload=”link();”>
goes in the following script instead of the body and hooked up to the id “url.”
[QUOTE]
<script type=”text/javascript”>
arr = new Array(
[“Link name google”,”
[“Link name yahoo”,”
[“Link name msn”,”
);
function link(){
document.getElementById(“url”).href = arr[new Date().getSeconds()][1];
document.getElementById(“url”).innerHTML = arr[new Date().getSeconds()][0]; setTimeout(‘link()’,1000);}
</script>
This in the body
<a href=”#” id=”url”></a>
Reason why is because I am going to be using more than one onload later. I’ts going to be easier to have my onloads hooked up to the id. Please let me know, thank you very much