ProcessingInstruction: hasAttributes() Methode
Die hasAttributes() Methode des ProcessingInstruction-Interfaces gibt einen booleschen Wert zurück, der anzeigt, ob das aktuelle Element Attribute hat oder nicht.
Syntax
js
hasAttributes()
Parameter
Keine.
Rückgabewert
Ein boolescher Wert.
Beispiele
>Grundlegende Verwendung
js
const pi = document.createProcessingInstruction("start", 'name="placeholder"');
const pi2 = document.createProcessingInstruction("start", "");
console.log(pi.hasAttributes());
console.log(pi2.hasAttributes());
// logs:
// true
// false
Spezifikationen
| Spezifikation |
|---|
| DOM> # dom-processinginstruction-hasattributes> |