You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Notice how you can include `autocomplete='on'`on the form element and it will apply to all inputs in your form. You can also set different [values for autocomplete attribute](https://developer.mozilla.org/en-US/docs/Web/HTML/Attributes/autocomplete) for each input.
If you inspect this element in your chrome developer tools and open the Accessibility tab inside the Elements tab, you will see how the input gets its name from the label:
Though you might have seen labels wrapping the input fields like this:
54
+
以下のように入力欄をラップしているラベルを見たことがあるかもしれません:
55
55
56
56
```html
57
57
<label>
@@ -60,12 +60,12 @@ Though you might have seen labels wrapping the input fields like this:
60
60
</label>
61
61
```
62
62
63
-
Explicitly setting the labels with an matching id is better supported by assistive technology.
63
+
一致する id で明示的にラベルを設定することは支援技術によってより適切にサポートされます。
64
64
:::
65
65
66
66
#### aria-label
67
67
68
-
You can also give the input an accessible name with [`aria-label`](https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA/ARIA_Techniques/Using_the_aria-label_attribute).
Using [`aria-labelledby`](https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA/ARIA_Techniques/Using_the_aria-labelledby_attribute)is similar to `aria-label`expect it is used if the label text is visible on screen. It is paired to other elements by their `id`and you can link multiple `id`s:
[aria-describedby](https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA/ARIA_Techniques/Using_the_aria-describedby_attribute)is used the same way as `aria-labelledby`expect provides a description with additional information that the user might need. This can be used to describe the criteria for any input:

Avoid using placeholders as they can confuse many users.
168
+
多くのユーザが混乱する可能性があるため、プレースホルダの使用は避けてください。
169
169
170
-
One of the issues with placeholders is that they don't meet the [color contrast criteria](https://www.w3.org/WAI/WCAG21/Understanding/contrast-minimum.html)by default; fixing the color contrast makes the placeholder look like pre-populated data in the input fields. Looking at the following example, you can see that the Last Name placeholder which meets the color contrast criteria looks like pre-populated data:
170
+
プレースホルダによる問題の1つは初期状態で [color contrast criteria](https://www.w3.org/WAI/WCAG21/Understanding/contrast-minimum.html)を満たしていないことです。色のコントラストを修正するとプレースホルダが入力欄に事前入力されたデータのように見えます。以下の例を見ると、color contrast criteria を満たしている Last Name プレースホルダが事前入力されたデータのように見えることが確認できます:
It is best to provide all the information the user needs to fill out forms outside any inputs.
179
+
ユーザがフォームを入力するために必要とするすべての情報を入力欄の外側で提供するのが最善です。
180
180
181
-
### Instructions
181
+
### 説明
182
182
183
-
When adding instructions for your input fields, make sure to link it correctly to the input.
184
-
You can provide additional instructions and bind multiple ids inside an [`aria-labelledby`](https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA/ARIA_Techniques/Using_the_aria-labelledby_attribute). This allows for more flexible design.
183
+
入力欄に説明を追加するとき、入力欄に対して正しくリンクしていることを確認してください。
184
+
あなたは追加の説明を提供し、複数の id を [`aria-labelledby`](https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA/ARIA_Techniques/Using_the_aria-labelledby_attribute) 内に束縛することができます。これにより、さらに柔軟な設計が可能になります。
185
185
186
186
```html
187
187
<fieldset>
@@ -197,7 +197,7 @@ You can provide additional instructions and bind multiple ids inside an [`aria-l
197
197
</fieldset>
198
198
```
199
199
200
-
Alternatively, you can attach the instructions to the input with [`aria-describedby`](https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA/ARIA_Techniques/Using_the_aria-describedby_attribute):
Usually it is not recommended to visually hide labels, even if the input has an accessible name. However, if the functionality of the input can be understood with surrounding content, then we can hide the visual label.
@@ -256,17 +256,17 @@ We can use CSS to visually hide elements but keep them available for assistive t
256
256
257
257
#### aria-hidden="true"
258
258
259
-
Adding`aria-hidden="true"`will hide the element from assistive technology but leave it visually available for other users. Do not use it on focusable elements, purely on decorative, duplicated or offscreen content.
0 commit comments