Re: attributes

Don Park (donpark@quake.net)
Wed, 23 Sep 1998 11:53:43 -0700


Eddie,

>how you can know if an
>xml attribute
>is present with JavaScript?
>
>I tried this:
>
> if (theElement.getAttribute("MANAGER") != null)
> aText += "&manager=" + theElement.getAttribute("MANAGER");

getAttribute will return empty string if attribute is not present. Use
getAttributeNode.

if (theElement.getAttributeNode("MANAGER") != null)

Don Park
Docuverse