On Fri, 11 Mar 2005 08:23:40 -0500, Alan Trick <[EMAIL PROTECTED]> wrote:
> I'm getting undefined instead of DOCUMENT_NODE or 9? I used
> if(aNode.tagName){ ...} to achive the required result, but it's a hack
> and I want to know what's wrong with nodeType?
I suspect it's because you've returned a NodeList collection rather
than a node. If you have a NodeList collection, you'll need to
reference the element by its index:
var objNodeList = document.getElementsByTagName('head');
alert(objNodeList[0].nodeType);
If you've returned a node using getElementById, you can use nodeType directly.
Best regards,
Gez
_____________________________
Supplement your vitamins
http://juicystudio.com
******************************************************
The discussion list for http://webstandardsgroup.org/
See http://webstandardsgroup.org/mail/guidelines.cfm
for some hints on posting to the list & getting help
******************************************************