XML DOM » ProcessingInstruction » data

Syntax:
processingInstruction.data

This is a read-only property that returns the 'content' of a ProcessingInstruction.

The data property is read-only and returns the 'content' of a processing instruction. This consists of everything from the first non-white-space character after the target through the character immediately before the '?>' which terminates the instruction. This value is the same as that returned by the nodeValue property for a processing instruction.

Examples

Code:
pi = xml_doc.firstChild;
document.write(pi.data);
Output:
version="1.0"
Explanation:

This example uses a typical processing instruction for an XML document:

<?xml version="1.0"?>

The code creates a ProcessingInstruction node and then displays the value contained in the data property.

Language(s): JavaScript