numberValue property (XPathResult)
If the type of the result represented by the XPathResult object is number, returns the value of the result.
The XPathResult object represents the result of the evaluate method.
The type of the result depends on the fourth parameter of the evaluate method, or, if its value is ANY_TYPE, on the expression specified by the first parameter. With the resultType property, the type of the result can be retrieved. If the value of the resultType property is NUMBER_TYPE, then the numberValue property retrieves the value of the result as a number, else the use of the numberValue property raises an exception.
You can find the related objects in the Supported by objects section below.
This property is read-only.
Integer that retrieves the value represented by the current XPathResult object.
Default: this property has no default value.
Example HTML code 1:
This example illustrates the use of the numberValue property:
Did you find this example helpful?
User Contributed Comments