05-09-2004, 10:17 PM
my dts are telling me that they are spans in gecko (mozilla 1.7 and firefox)
var adtnotaspan = document.getElementsByTagName('dt').;
alert(adtnotaspan) shows objectHTMLSpanElement
is this my stupidity or the browsers?
05-09-2004, 10:27 PM
In my browser (Firefox 0.8), it alerts 'DT'...
Happy coding! :)
05-10-2004, 10:06 PM
Well, you could argue that Mozilla is wrong here. That should be [object HTMLElement], not [object HTMLSpanElement]. However, the DOM wastes no interface for alike elements, but Mozilla might just have to. The elements span and dt are practically the same, though. Neither one of them adds something over the other. So, I'm not surprised they clumped them together in one object.
Note that op7.50 does exactly as the DOM specifies and returns [object HTMLElement].
Anyway, the DOM does allow for extending from the part of user agents, and there is really nothing that says that the DOM interfaces should be implemented as objects and prototypes, so you should be glad it tells you anything at all about the object.