aboutsummaryrefslogtreecommitdiff
path: root/files/ja
diff options
context:
space:
mode:
Diffstat (limited to 'files/ja')
-rw-r--r--files/ja/web/api/shadowroot/activeelement/index.md46
1 files changed, 46 insertions, 0 deletions
diff --git a/files/ja/web/api/shadowroot/activeelement/index.md b/files/ja/web/api/shadowroot/activeelement/index.md
new file mode 100644
index 0000000000..e2e275dba3
--- /dev/null
+++ b/files/ja/web/api/shadowroot/activeelement/index.md
@@ -0,0 +1,46 @@
+---
+title: ShadowRoot.activeElement
+slug: Web/API/ShadowRoot/activeElement
+tags:
+ - API
+ - プロパティ
+ - リファレンス
+ - ShadowRoot
+ - ウェブコンポーネント
+ - シャドウ DOM
+browser-compat: api.ShadowRoot.activeElement
+translation_of: Web/API/ShadowRoot/activeElement
+---
+{{APIRef("Shadow DOM")}}
+
+**`activeElement`** は {{domxref("ShadowRoot")}} インターフェイスの読み取り専用プロパティで、シャドウツリー内でフォーカスを持っている要素を返します。
+
+## 構文
+
+```js
+shadowRoot.activeElement
+```
+
+### 値
+
+現在フォーカスを持っている {{domxref('Element')}}、またはフォーカスを持っている要素がなければ `null` です。
+
+## 例
+
+```js
+let customElem = document.querySelector('my-shadow-dom-element');
+let shadow = customElem.shadowRoot;
+let focusedElem = shadow.activeElement;
+```
+
+## 仕様書
+
+{{Specifications}}
+
+## ブラウザーの互換性
+
+{{Compat}}
+
+## 関連情報
+
+- {{domxref("Document.activeElement")}}