coderef

HTML processing instructionsLimited availability

An HTML processing instruction is text enclosed by <? and >, which marks a target for further processing. They may appear anywhere in a document. They are ignored like comments when they're not recognized for a specific purpose.

Not yet supported in all major browsers — check the table and provide a fallback.

Browser support

DesktopChrome
1–149Not supported
150+Supportedsince Jun 30, 2026
Current: 155
Edge
12–149Not supported
150+Supportedsince Jul 2, 2026
Current: 154
Firefox
✕Not supportedup to 157
Current: 157
Safari
✕Not supportedup to 27
Current: 27
MobileChrome Android
18–149Not supported
150+Supportedsince Jun 30, 2026
Current: 155
Firefox Android
✕Not supportedup to 157
Current: 157
Safari iOS
✕Not supportedup to 27
Current: 27

How to use

Not supported in Firefox, Safari, Firefox Android, Safari iOS. Use feature detection below and provide a fallback (or a polyfill) for those browsers.

Example

Full syntax and examples are on MDN: getAttribute.

Feature detection

JS · check before using
if ("ProcessingInstruction" in globalThis && "doc_html" in ProcessingInstruction.prototype) {
  // ProcessingInstruction.doc_html is available
}

Sub-features

Support for each part of the feature (8). The overall table above shows when the whole feature works.

Sub-featureChromeEdgeFirefoxSafariChrome AndroidFirefox AndroidSafari iOS
ProcessingInstruction.doc_html150150✕✕150✕✕
ProcessingInstruction.getAttribute150150✕✕150✕✕
ProcessingInstruction.getAttributeNames150150✕✕150✕✕
ProcessingInstruction.hasAttribute150150✕✕150✕✕
ProcessingInstruction.hasAttributes150150✕✕150✕✕
ProcessingInstruction.removeAttribute150150✕✕150✕✕
ProcessingInstruction.setAttribute150150✕✕150✕✕
ProcessingInstruction.toggleAttribute150150✕✕150✕✕