Skip to content

Commit

Permalink
Further refine based on feedback
Browse files Browse the repository at this point in the history
  • Loading branch information
mcking65 committed Dec 17, 2023
1 parent d6f03eb commit fc57d9b
Showing 1 changed file with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -307,16 +307,16 @@ <h3>Naming Form Controls with the Label Element</h3>
However, unless the text is programmatically associated with the checkbox, assistive technology users will experience a checkbox without a label.
</p>
<p>
HTML provides two syntaxes for associating a label with a form control.
The syntax with the broadest browser and assistive technology support is to set the <code>for</code> attribute on the <code>label</code> element to the <code>id</code> of the control.
HTML provides two ways of associating a label with a form control.
The one that provides the broadest browser and assistive technology support is to set the <code>for</code> attribute on the <code>label</code> element to the <code>id</code> of the control.
This way of associating the label with the control is often called explicit association.
</p>

<pre><code>&lt;input type="checkbox" name="subscribe" id="subscribe_checkbox"&gt;
&lt;label for="subscribe_checkbox"&gt;subscribe to our newsletter&lt;/label&gt;</code></pre>

<p>
The other syntax, which is known as implicit association, is to wrap the checkbox and the labeling text in a <code>label</code> element.
The other way, which is known as implicit association, is to wrap the checkbox and the labeling text in a <code>label</code> element.
Some combinations of assistive technologies and browsers fail to treat the element as having an accessible name that is specified by using implicit association.
</p>

Expand Down

0 comments on commit fc57d9b

Please sign in to comment.