YouTip LogoYouTip

Dom Prop Attr Name

XML DOM name Property | Tutorial

Tutorial -- Learning Not Just Technology, But Dreams!

XML DOM Tutorial

XML DOM Tutorial DOM Introduction DOM Nodes DOM Node Tree DOM Parser DOM Load Function DOM Methods DOM Access DOM Node Information DOM NodeList DOM Traversal DOM Browser DOM Navigation DOM Get Node DOM Change Node DOM Remove Node DOM Replace Node DOM Create Node DOM Add Node DOM Clone Node DOM XMLHttpRequest DOM Node Types DOM Node DOM NodeList DOM NamedNodeMap DOM Document DOM DocumentImpl DOM DocumentType DOM ProcessingInst DOM Element DOM Attribute DOM Text DOM CDATA DOM Comment DOM XMLHttpRequest DOM ParseError Obj DOM Parser Errors DOM Summary DOM Examples DOM Validation

XML DOM - Element Object

XML DOM - Text Object

Deep Dive

  • Scripting Languages
  • Computer Science
  • Web Browsers
  • Scripts
  • Development Tools
  • Software
  • Programming
  • Web Design & Development
  • Web Service
  • Web Services

XML DOM name Property


Attr Object Reference Attr Object


Definition and Usage

The name property returns the name of the attribute.

Syntax

attrObject.name


Example

The following code snippet uses loadXMLDoc() to load "books.xml" into xmlDoc and displays the name and value of the category attribute:

Example

xmlDoc=loadXMLDoc("books.xml");

x=xmlDoc.getElementsByTagName('book');

for(i=0;i<x.length;i++)
{
    document.write(x.item(i).attributes.name);
    document.write(" = ");
    document.write(x.item(i).attributes.value);
    document.write("<br>");
}

Output:

category = COOKING
category = CHILDREN
category = WEB
category = WEB

Try it Yourself Β»


Attr Object Reference Attr Object

← Prop Attr NamespaceuriMet Cdata Deletedata β†’