diff options
author | Peter Bengtsson <mail@peterbe.com> | 2020-12-08 14:40:17 -0500 |
---|---|---|
committer | Peter Bengtsson <mail@peterbe.com> | 2020-12-08 14:40:17 -0500 |
commit | 33058f2b292b3a581333bdfb21b8f671898c5060 (patch) | |
tree | 51c3e392513ec574331b2d3f85c394445ea803c6 /files/ja/web/api/htmlorforeignelement/blur/index.html | |
parent | 8b66d724f7caf0157093fb09cfec8fbd0c6ad50a (diff) | |
download | translated-content-33058f2b292b3a581333bdfb21b8f671898c5060.tar.gz translated-content-33058f2b292b3a581333bdfb21b8f671898c5060.tar.bz2 translated-content-33058f2b292b3a581333bdfb21b8f671898c5060.zip |
initial commit
Diffstat (limited to 'files/ja/web/api/htmlorforeignelement/blur/index.html')
-rw-r--r-- | files/ja/web/api/htmlorforeignelement/blur/index.html | 88 |
1 files changed, 88 insertions, 0 deletions
diff --git a/files/ja/web/api/htmlorforeignelement/blur/index.html b/files/ja/web/api/htmlorforeignelement/blur/index.html new file mode 100644 index 0000000000..8a9cea1f8c --- /dev/null +++ b/files/ja/web/api/htmlorforeignelement/blur/index.html @@ -0,0 +1,88 @@ +--- +title: HTMLElement.blur() +slug: Web/API/HTMLOrForeignElement/blur +tags: + - API + - HTML DOM + - HTMLElement + - Method + - Reference +translation_of: Web/API/HTMLOrForeignElement/blur +--- +<div>{{ APIRef("HTML DOM") }}</div> + +<p><span class="seoSummary"><code><strong>HTMLElement.blur()</strong></code> メソッドは、現在の要素からキーボードフォーカスを取り除きます。</span></p> + +<h2 id="Syntax" name="Syntax">構文</h2> + +<pre class="syntaxbox"><em>element</em>.blur();</pre> + +<h2 id="Examples" name="Examples">例</h2> + +<h3 id="Remove_focus_from_a_text_input" name="Remove_focus_from_a_text_input">テキスト入力からフォーカスを取り除く</h3> + +<h4 id="HTML" name="HTML">HTML</h4> + +<pre class="brush: html"><input type="text" id="myText" value="サンプルテキスト"> +<br><br> +<button type="button" onclick="focusInput()">クリックするとフォーカスを得ます</button> +<button type="button" onclick="blurInput()">クリックするとフォーカスを失います</button></pre> + +<h4 id="JavaScript" name="JavaScript">JavaScript</h4> + +<pre class="brush: js">function focusInput() { + document.getElementById('myText').focus(); +} +function blurInput() { + document.getElementById('myText').blur(); +}</pre> + +<h4 id="Result" name="Result">結果</h4> + +<p>{{ EmbedLiveSample('Remove_focus_from_a_text_input') }}</p> + +<h2 id="Specification" name="Specification">仕様</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('HTML WHATWG', 'editing.html#dom-blur', 'blur')}}</td> + <td>{{Spec2('HTML WHATWG')}}</td> + <td></td> + </tr> + <tr> + <td>{{SpecName('HTML5.1', 'editing.html#blur()-0', 'blur')}}</td> + <td>{{Spec2('HTML5.1')}}</td> + <td></td> + </tr> + <tr> + <td>{{SpecName('HTML5 W3C', 'editing.html#dom-blur', 'blur')}}</td> + <td>{{Spec2('HTML5 W3C')}}</td> + <td></td> + </tr> + <tr> + <td>{{SpecName('DOM2 HTML', 'html.html#ID-28216144', 'blur')}}</td> + <td>{{Spec2('DOM2 HTML')}}</td> + <td></td> + </tr> + </tbody> +</table> + +<h2 id="Browser_compatibility" name="Browser_compatibility">ブラウザーの互換性</h2> + + + +<p>{{Compat("api.HTMLElement.blur")}}</p> + +<h2 id="See_also" name="See_also">関連情報</h2> + +<ul> + <li>DOM メソッドの {{domxref("HTMLElement.focus()")}}</li> +</ul> |