Name

Document.createProcessingInstruction( ) — create a ProcessingInstruction node

Availability

DOM Level 1 Core

Synopsis

ProcessingInstruction createProcessingInstruction(String target, 
                                                  String data) 
     throws DOMException;

Arguments

target

The target of the processing instruction.

data

The content text of the processing instruction.

Returns

A newly created ProcessingInstruction node.

Throws

This method may throw a DOMException with one of the following code values in the following circumstances:

INVALID_CHARACTER_ERR

The specified target contains an illegal character.

NOT_SUPPORTED_ERR

This is an HTML document and does not support processing instructions.

Get JavaScript: The Definitive Guide, Fourth Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.