From 485a48198a98d7213af29b946d473c9c3329a6b1 Mon Sep 17 00:00:00 2001 From: Masahiro FUJIMOTO Date: Tue, 26 Oct 2021 23:36:43 +0900 Subject: HTMLSelectElement 以下の変換準備 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../web/api/htmlselectelement/autofocus/index.html | 70 ---------------------- .../web/api/htmlselectelement/autofocus/index.md | 70 ++++++++++++++++++++++ 2 files changed, 70 insertions(+), 70 deletions(-) delete mode 100644 files/ja/web/api/htmlselectelement/autofocus/index.html create mode 100644 files/ja/web/api/htmlselectelement/autofocus/index.md (limited to 'files/ja/web/api/htmlselectelement/autofocus') diff --git a/files/ja/web/api/htmlselectelement/autofocus/index.html b/files/ja/web/api/htmlselectelement/autofocus/index.html deleted file mode 100644 index e3374e8fc3..0000000000 --- a/files/ja/web/api/htmlselectelement/autofocus/index.html +++ /dev/null @@ -1,70 +0,0 @@ ---- -title: HTMLSelectElement.autofocus -slug: Web/API/HTMLSelectElement/autofocus -tags: -- API -- HTML forms -- HTMLSelectElement -- Property -- Reference -translation_of: Web/API/HTMLSelectElement/autofocus ---- -

{{ APIRef("HTML DOM") }}

- -

HTMLSelectElement.autofocus プロパティは、 HTML の {{htmlattrxref("autofocus", "select")}} 属性を反映した true または false の値を持ちます。これはユーザーが上書きしない限り、ページが読み込まれた際に関連付けられた {{HTMLElement("select")}} 要素がページ読み込み時に入力フォーカスを得るかどうかを示します。

- -

この属性を指定することができるのは、 1 つの文書内のフォーム関連要素 1 つだけです。もし複数あった場合、属性が設定された最初の要素 (通常は該当する要素のうちページで最初のもの) が初期のフォーカスを得ます。

- -
-

このプロパティを設定しても、関連付けられた {{HTMLElement("select")}} 要素へフォーカスは設定されません。単純に文書へ 要素が挿入された ときにブラウザーへフォーカスを移動するよう指示するだけです。挿入後に設定した場合、すなわち文書が読み込まれた後のほとんどの場合では、目に見える効果はありません。

-
- -

構文

- -
aBool = aSelectElement.autofocus; // Get the value of autofocus
-aSelectElement.autofocus = aBool; // Set the value of autofocus
-
- -

- -

HTML

- -
<select id="mySelect" autofocus>
-  <option>Option 1</option>
-  <option>Option 2</option>
-</select>
-
- -

JavaScript

- -
// Check if the autofocus attribute on the <select>
-var hasAutofocus = document.getElementById('mySelect').autofocus;
-
- -

仕様書

- - - - - - - - - - - - - - - - - - - -
仕様書状態備考
{{SpecName('HTML WHATWG', '#dom-fe-autofocus', 'autofocus')}}{{Spec2('HTML WHATWG')}}
{{SpecName('HTML5.2', - 'sec-forms.html#autofocusing-a-form-control-the-autofocus-attribute', - 'autofocus')}}{{Spec2('HTML5.2')}}
- -

ブラウザーの互換性

- -

{{Compat("api.HTMLSelectElement.autofocus")}}

diff --git a/files/ja/web/api/htmlselectelement/autofocus/index.md b/files/ja/web/api/htmlselectelement/autofocus/index.md new file mode 100644 index 0000000000..e3374e8fc3 --- /dev/null +++ b/files/ja/web/api/htmlselectelement/autofocus/index.md @@ -0,0 +1,70 @@ +--- +title: HTMLSelectElement.autofocus +slug: Web/API/HTMLSelectElement/autofocus +tags: +- API +- HTML forms +- HTMLSelectElement +- Property +- Reference +translation_of: Web/API/HTMLSelectElement/autofocus +--- +

{{ APIRef("HTML DOM") }}

+ +

HTMLSelectElement.autofocus プロパティは、 HTML の {{htmlattrxref("autofocus", "select")}} 属性を反映した true または false の値を持ちます。これはユーザーが上書きしない限り、ページが読み込まれた際に関連付けられた {{HTMLElement("select")}} 要素がページ読み込み時に入力フォーカスを得るかどうかを示します。

+ +

この属性を指定することができるのは、 1 つの文書内のフォーム関連要素 1 つだけです。もし複数あった場合、属性が設定された最初の要素 (通常は該当する要素のうちページで最初のもの) が初期のフォーカスを得ます。

+ +
+

このプロパティを設定しても、関連付けられた {{HTMLElement("select")}} 要素へフォーカスは設定されません。単純に文書へ 要素が挿入された ときにブラウザーへフォーカスを移動するよう指示するだけです。挿入後に設定した場合、すなわち文書が読み込まれた後のほとんどの場合では、目に見える効果はありません。

+
+ +

構文

+ +
aBool = aSelectElement.autofocus; // Get the value of autofocus
+aSelectElement.autofocus = aBool; // Set the value of autofocus
+
+ +

+ +

HTML

+ +
<select id="mySelect" autofocus>
+  <option>Option 1</option>
+  <option>Option 2</option>
+</select>
+
+ +

JavaScript

+ +
// Check if the autofocus attribute on the <select>
+var hasAutofocus = document.getElementById('mySelect').autofocus;
+
+ +

仕様書

+ + + + + + + + + + + + + + + + + + + +
仕様書状態備考
{{SpecName('HTML WHATWG', '#dom-fe-autofocus', 'autofocus')}}{{Spec2('HTML WHATWG')}}
{{SpecName('HTML5.2', + 'sec-forms.html#autofocusing-a-form-control-the-autofocus-attribute', + 'autofocus')}}{{Spec2('HTML5.2')}}
+ +

ブラウザーの互換性

+ +

{{Compat("api.HTMLSelectElement.autofocus")}}

-- cgit v1.2.3-54-g00ecf