CSSPseudoElement: type プロパティ
Limited availability
This feature is not Baseline because it does not work in some of the most widely-used browsers.
Experimental: これは実験的な機能です。
本番で使用する前にブラウザー互換性一覧表をチェックしてください。
type は CSSPseudoElement インターフェイスの読み取り専用プロパティで、擬似要素の型を CSS セレクターの形の文字列で表します。
値
以下の値のいずれかを格納する文字列です。
例
下記の例は、 CSSPseudoElement.type と Element.pseudo() の関係を示しています。
js
const myElement = document.querySelector("q");
const mySelector = "::after";
const cssPseudoElement = myElement.pseudo(mySelector);
const typeOfPseudoElement = cssPseudoElement.type;
console.log(mySelector === typeOfPseudoElement); // true を出力
仕様書
| Specification |
|---|
| CSS Pseudo-Elements Module Level 4> # dom-csspseudoelement-type> |
ブラウザーの互換性
Loading…