[Javascript] Setting title of web page

Kamaleshwar Morjal kamaleshwar.morjal at gmail.com
Sun May 11 12:12:43 CDT 2008


On Sun, May 11, 2008 at 4:19 PM, Skip Evans <skip at bigskypenguin.com> wrote:

> Hey all,
>
> I'm trying to change the actual title tag value in
> the <head> section using the DOM. But with Google
> finding the attributes to set for title is tough,
> because the word title searches all kinds of other
> stuff but not <head><title>....</title></head>
>
> So anyway, I can get the title by tag name:
>
> var title=document.getElementsByTagName('title');
>
> But I can't find the right arguments to pass to
>
> setAttribute('?????','New Page Title');
>

just setting

document.title =  [your title string];

works for me.. :)

cheers!

-- 
"Best things in the world are free; FREEDOM is priceless!"
kamaleshwar morjal
(कमलेश्वर मोरजाल)
Cell Ph: +91-992-019-3637


More information about the Javascript mailing list