The hasAttributes() method of the ProcessingInstruction interface returns a boolean value indicating whether the current element has any attributes or not.
hasAttributes()None.
A boolean.
const pi = document.createProcessingInstruction("start", 'name="placeholder"');
const pi2 = document.createProcessingInstruction("start", "");
console.log(pi.hasAttributes());
console.log(pi2.hasAttributes());
// logs:
// true
// false