This feature is well established and works across many devices and browser versions. It’s been available across browsers since July 2015.
The ProcessingInstruction interface represents a processing instruction; that is, a Node which embeds an instruction targeting a specific application but that can be ignored by any other applications which don't recognize the instruction.
Warning: ProcessingInstruction nodes are only supported in XML documents, not in HTML documents. In these, a process instruction will be considered as a comment and be represented as a Comment object in the tree.
A processing instruction may be different than the XML declaration.
Note: User-defined processing instructions cannot begin with "xml", as xml-prefixed processing-instruction target names are reserved by the XML specification for particular, standard uses (see, for example, <?xml-stylesheet ?>.
For example:
<?xml version="1.0"?>
is a processing instruction whose target is xml.
This interface also inherits properties from its parent interfaces, CharacterData, Node, and EventTarget.
ProcessingInstruction.sheet Read only
Returns the associated StyleSheet object, if any; or null if none.
ProcessingInstruction.target Read only
A name identifying the application to which the instruction is targeted.
This interface doesn't have any specific method, but inherits methods from its parent interfaces, CharacterData, Node, and EventTarget.
| Specification |
|---|
| DOM> # interface-processinginstruction> |
| Desktop | Mobile | |||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Chrome | Edge | Firefox | Opera | Safari | Chrome Android | Firefox for Android | Opera Android | Safari on IOS | Samsung Internet | WebView Android | WebView on iOS | |
ProcessingInstruction |
1 | 12 | 1 | ≤12.1 | 1 | 18 | 4 | ≤12.1 | 1 | 1.0 | 4.4 | 1 |
sheet |
1 | 79 | 1 | 15 | 1 | 18 | 4 | 14 | 1 | 1.0 | 4.4 | 1 |
target |
1 | 12 | 1 | ≤12.1 | 1 | 18 | 4 | ≤12.1 | 1 | 1.0 | 4.4 | 1 |
© 2005–2025 MDN contributors.
Licensed under the Creative Commons Attribution-ShareAlike License v2.5 or later.
https://developer.mozilla.org/en-US/docs/Web/API/ProcessingInstruction