value Property
Last Updated: 08-27-2005
Retrieves the value of the Attribute.

Syntax
var sAttrValue = Attribute.value;

Possible Values
sAttrValue The value of the attribute.

Examples

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">
      <script>
      <![CDATA[
         // 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.name + "=" + oAttr.value);
         }
       ]]>
       </script>
   </form>
</vxml>


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