PDA

View Full Version : title tag


trancedm
10-08-2005, 11:20 AM
hello CF,

is there a way to retrieve the information inside the <title></title> tag with javascript?

thanks for reading

martin_narg
10-08-2005, 11:32 AM
var theTitle = getElementsByTagName("title")[0].innerHTML;
Hope this helps

m_n

trancedm
10-08-2005, 01:00 PM
thanks

i had to use


var desc = document.getElementsByTagName("title")[0].innerHTML;


i dont know why but its working fine

thanks for the help

martin_narg
10-08-2005, 02:45 PM
oops

my bad, yes it should be document - can't see how i missed that!

m_n

gph
10-08-2005, 02:50 PM
you can get it like this as well

document.title