const pi = document.createProcessingInstruction("start", 'name="placeholder"');
const pi2 = document.createProcessingInstruction("start", "");
console.log(pi.hasAttributes());
console.log(pi2.hasAttributes());
// logs:
// true
// falseProcessingInstruction: hasAttributes() method
Runnable notebook: every JavaScript, HTML and CSS example on this page executes in a sandboxed local frame. Nothing leaves the browser.