> "fr**********@usa.com" <fr**********@usa.com> wrote:
news:11**********************@f14g2000cwb.googlegr oups.com....
Hi.
I'm trying to insert some text between <head> and <body> but I'm
not able.
I try with:
--------
bodyPoint = document.getElementsByTagName('body');
var myLink = document.createElement("a");
myLink.href = "http://www.yahoo.com";
myLink.innerHTML = "Yahoo";
bodyPoint.insertBefore(myLink, bodyPoint);
---------
but it doesn't work. I get this error
-----------
bodyPoint.insertBefore is not a function
--------------
What am I doing wrong? Thx.
window.onload=function(){
htm = document.getElementsByTagName('html')
myLink = document.createElement("a");
myLink.href = "http://www.yahoo.com";
txt = document.createTextNode('Yahoo')
myLink.appendChild(txt)
htm[0].insertBefore(myLink,document.body);
alert(htm[0].innerHTML)
}
--
BootNic Sunday, July 24, 2005 4:05 PM
Good communication is as stimulating as black coffee and just as hard to sleep after.
*Anne Morrow Lindbergh*