XML DOM - XML DOM Element Object - DOM Element Object Method getAttribute - XML DOM

Explain the getAttribute method of the Element Object

The value of the attribute of a specified element is provided by the getAttribute method.


The syntax for the getAttribute method is as follows:

Parameter & Description
It holds the name of the attribute to retrieve.


The contents of the node.xml are as follows:

The illustration below displays the getAttribute method usage.


The file is saved as elementattribute_getattribute.html on the server path and this file should be on the same path as that of node.xml in the server. The output appears as follows:

All rights reserved © 2018 Wisdom IT Services India Pvt. Ltd DMCA.com Protection Status

XML DOM Topics