name Property
Retrieves the name of the Attribute.

var sAttrName =;

Possible Values
sAttrName The name of the attribute.


The example below uses the following data.

<?xml version="1.0"?>
<?access-control allow="*"?>
<time hours="12" minutes="30" seconds="59" zone="pst" />

The following example iterates through the attributes collection of an XML element representing the time, and prints the name and value of each attribute in the collection to the debug log.

<vxml version="2.0">
   <data name="oTime" src="time.exml"/>
   <form id="main">
         // cache the root document element
         var oRoot = oTime.documentElement;
         // cache the root doc element's attributes collection
         var oAttrs = oRoot.attributes;
         // cache the count of attribute
         var iAttrs = oRoot.attributes.length;
         // iterate through the collection
         for (var i = 0; i < iAttrs; i++)
            // cache the attribute
            var oAttr = oAttrs.item(i);
            // log the name/value
            vxmllog( + "=" + oAttr.value);

Applies To
[24]7 Inc.| Terms of Service| Privacy Policy| General Disclaimers