XML DOM createProcessingInstruction() method

Document object reference manual

Definition and usage

The createProcessingInstruction() method creates a ProcessingInstruction node.

Syntax:

createProcessingInstruction(target,data)
Parameters Description
target The target of the processing instruction.
data The content text of the processing instruction.

Return value

a newly created ProcessingInstruction node.

throw

If target If it contains illegal characters, an error with code INVALID_CHARACTER_ERR will be thrown DOMException exception.

If it is an HTML document, processing instructions are not supported and an error with code NOT_SUPPORTED_ERR will be thrown DOMException exception.

Document object reference manual