aboutsummaryrefslogtreecommitdiff
path: root/files/ja/web/api/element/focusin_event/index.md
diff options
context:
space:
mode:
authorMasahiro FUJIMOTO <mfujimot@gmail.com>2022-01-09 16:15:16 +0900
committerMasahiro FUJIMOTO <mfujimot@gmail.com>2022-01-20 00:15:02 +0900
commite9eae2d4257e8e561a6234c9a0baf1bd1166f707 (patch)
tree95afd5ad6ce8e1a41b1bb2798045400f35288ce2 /files/ja/web/api/element/focusin_event/index.md
parent29aaf47e4a0ef0ebcb3d2f278fe50cacab20588f (diff)
downloadtranslated-content-e9eae2d4257e8e561a6234c9a0baf1bd1166f707.tar.gz
translated-content-e9eae2d4257e8e561a6234c9a0baf1bd1166f707.tar.bz2
translated-content-e9eae2d4257e8e561a6234c9a0baf1bd1166f707.zip
FocusEvent 関係のインターフェイス・イベントの記事を変換準備
Diffstat (limited to 'files/ja/web/api/element/focusin_event/index.md')
-rw-r--r--files/ja/web/api/element/focusin_event/index.md109
1 files changed, 109 insertions, 0 deletions
diff --git a/files/ja/web/api/element/focusin_event/index.md b/files/ja/web/api/element/focusin_event/index.md
new file mode 100644
index 0000000000..82f3fada9f
--- /dev/null
+++ b/files/ja/web/api/element/focusin_event/index.md
@@ -0,0 +1,109 @@
+---
+title: 'Element: focusin イベント'
+slug: Web/API/Element/focusin_event
+tags:
+ - API
+ - DOM
+ - Element
+ - Event
+ - FocusEvent
+ - Reference
+ - focusin
+ - イベント
+translation_of: Web/API/Element/focusin_event
+---
+<div>{{APIRef}}</div>
+
+<p><strong><code>focusin</code></strong> イベントは、要素がフォーカスを受け取ろうとしているときに発生します。このイベントと {{domxref("Element/focus_event", "focus")}} との主な違いは、 <code>focusin</code> がバブリングを行うのに対し <code>focus</code> は行わないことです。</p>
+
+<p><code>focusin</code> の反対は {{domxref("Element/focusout_event", "focusout")}} です。</p>
+
+<table class="properties">
+ <tbody>
+ <tr>
+ <th scope="row">バブリング</th>
+ <td>あり</td>
+ </tr>
+ <tr>
+ <th scope="row">キャンセル可能</th>
+ <td>いいえ</td>
+ </tr>
+ <tr>
+ <th scope="row">インターフェイス</th>
+ <td>{{DOMxRef("FocusEvent")}}</td>
+ </tr>
+ <tr>
+ <th scope="row">イベントハンドラープロパティ</th>
+ <td>{{domxref("GlobalEventHandlers/onfocusin", "onfocusin")}}</td>
+ </tr>
+ <tr>
+ <th scope="row">同期 / 非同期</th>
+ <td>同期</td>
+ </tr>
+ <tr>
+ <th scope="row">Composed</th>
+ <td>はい</td>
+ </tr>
+ </tbody>
+</table>
+
+<h2 id="Examples" name="Examples">例</h2>
+
+<h3 id="Live_example" name="Live_example">ライブデモ</h3>
+
+<h4 id="HTML">HTML</h4>
+
+<pre class="brush: html">&lt;form id="form"&gt;
+ &lt;input type="text" placeholder="text input"&gt;
+ &lt;input type="password" placeholder="password"&gt;
+&lt;/form&gt;</pre>
+
+<h4 id="JavaScript">JavaScript</h4>
+
+<pre class="brush: js">const form = document.getElementById('form');
+
+form.addEventListener('focusin', (event) =&gt; {
+ event.target.style.background = 'pink';
+});
+
+form.addEventListener('focusout', (event) =&gt; {
+ event.target.style.background = '';
+});</pre>
+
+<h4 id="Result" name="Result">結果</h4>
+
+<p>{{EmbedLiveSample("Live_example", '100%', '50px')}}</p>
+
+<h2 id="Specifications" name="Specifications">仕様書</h2>
+
+<table class="standard-table">
+ <thead>
+ <tr>
+ <th scope="col">仕様書</th>
+ <th scope="col">状態</th>
+ <th scope="col">備考</th>
+ </tr>
+ </thead>
+ <tbody>
+ <tr>
+ <td>{{SpecName("UI Events", "#event-type-focusin")}}</td>
+ <td>{{Spec2("UI Events")}}</td>
+ <td>Added info that this event is composed.</td>
+ </tr>
+ <tr>
+ <td>{{SpecName("DOM3 Events", "#event-type-focusin")}}</td>
+ <td>{{Spec2("DOM3 Events")}}</td>
+ <td>初回定義</td>
+ </tr>
+ </tbody>
+</table>
+
+<h2 id="Browser_compatibility" name="Browser_compatibility">ブラウザーの対応</h2>
+
+<p>{{Compat("api.Element.focusin_event")}}</p>
+
+<h2 id="See_also" name="See_also">関連情報</h2>
+
+<ul>
+ <li>関連イベント: {{domxref("Element/blur_event", "blur")}}, {{domxref("Element/focus_event", "focus")}}, {{domxref("Element/focusout_event", "focusout")}}</li>
+</ul>