I'm trying convert document.write to document.getElementById
but it is not working and I can't seem to figure it out.



This is my original code:
Code:
var myurl = new Array("google.com", "yahoo.com"); 
                
for (i=0;i<=myurl.length-1;i++){
   document.write("<a href='http://www." +  myurl[i] + " target='_blank'>"+ myurl[i]+"</a>");
}

I would like to convert to document.getElementById but it doesn't work.
Code:
<HTML>
<HEAD>
<TITLE>Test Input</TITLE>
<script type="text/javascript">

   var myurl = new Array("google.com", "yahoo.com"); 

   document.getElementById('info').innerHTML = "<table border=1><tr><td>";                

   for (i=0;i<=myurl.length-1;i++){
      document.getElementById('info').innerHTML += "<tr><td><a href='http://www." +  myurl[i] + " target='_blank'>"+ myurl[i]+"</a></tr></td>";
   }
   document.getElementById('info').innerHTML = "</tr></td></table>";
</script>
</HEAD>

<BODY>


<p id="info"></p>

</BODY>
</HTML>