[Javascript] dom/javascript question regarding Internet Explorer

Mike Dougherty mdougherty at pbp.com
Fri Jul 20 09:32:41 CDT 2007


On 7/20/07, Lee Bettridge <lbettridge at twowaytv.co.uk> wrote:
> This statement
>
> var title = document.getElementsByTagName("TITLE").item(0);
>
> in IE does not return on object but does in firefox, so I guess my
> question is, in IE is the <title/> tag simply inaccessible or accessible
> in some other Microsoft specific way ?

perhaps the issue is that .item(0) is a textnode due to whitespace in
the markup? getElementsByTagName() returns a collection, maybe you
need to iterate it and see what else is in there - maybe IE has placed
what you are after at different index?



More information about the Javascript mailing list