TOC PREV NEXT INDEX

domref



localName


localName returns the local part of the qualified name of this node.

Syntax

name = element.localName
 

Parameters

name is the local name as a string.

Example

// qualifiedName = "XXXYYY"
 
d = document.getElementById("div1");
 
text_field = document.getElementById("t");
 
text_field.setAttribute("value", d.localName);
 
// text_field reads "YYY"
 

Notes

For nodes of any type other than ELEMENT_NODE and ATTRIBUTE_NODE and nodes created with a DOM Level 1 method, such as createElement on the document object, this is always NULL.

The localname of a node is that part of the node's qualified name that comes after the colon. Qualified names are typically used in XML as part of the namespace(s) of the particular XML documents. For example, in the qualified name "ecomm:partners," "partners" is the localname and ecomm is the prefix:

<ecomm:business id="soda_shop" type="brick_n_mortar">
 
  <ecomm:partners>
 
    <ecomm:partner id="1001">Tony's Syrup Warehouse
 
    </ecomm:partner>
 
  </ecomm:partner>
 
</ecomm:business>
 

The prefix-in this case, "ecomm"-defines the namespace in which the localname can be used.

See Also

namespaceURI

Specification

localName
 


Netscape Communications
http://developer.netscape.com
TOC PREV NEXT INDEX