CSSPseudoElement: type-Eigenschaft
Experimentell: Dies ist eine experimentelle Technologie
Überprüfen Sie die Browser-Kompatibilitätstabelle sorgfältig vor der Verwendung auf produktiven Webseiten.
Die type
schreibgeschützte Eigenschaft des
CSSPseudoElement
-Interfaces gibt den Typ des Pseudoelements als Zeichenfolge zurück, dargestellt in Form eines CSS-Selectors.
Wert
Eine Zeichenfolge, die einen der folgenden Werte enthält:
Beispiele
Das folgende Beispiel zeigt die Beziehung zwischen
CSSPseudoElement.type
und Element.pseudo()
:
js
const myElement = document.querySelector("q");
const mySelector = "::after";
const cssPseudoElement = myElement.pseudo(mySelector);
const typeOfPseudoElement = cssPseudoElement.type;
console.log(mySelector === typeOfPseudoElement); // Outputs true
Spezifikationen
Specification |
---|
CSS Pseudo-Elements Module Level 4 # dom-csspseudoelement-type |
Browser-Kompatibilität
Report problems with this compatibility data on GitHubdesktop | mobile | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|
type |
Legend
Tip: you can click/tap on a cell for more information.
- No support
- No support
- Experimental. Expect behavior to change in the future.
- User must explicitly enable this feature.
The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request.