-
Notifications
You must be signed in to change notification settings - Fork 22.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Subpar accessibility recommendation #36068
Comments
to
I agree that a Terms and Conditions link should be in the DOM prior to the input asking people to agree to it. This is also one of the rare cases where opening a link in a new tab is preferable, to avoid people losing unsaved form input (if the checkbox was the only input, that wouldn't be a problem). <p>
<a href="terms-and-conditions.html" target="_blank">Read our Terms and Conditions</a>
</p>
<label for="tac">
<input id="tac" type="checkbox" name="terms-and-conditions" />
I agree to the Terms and Conditions
</label> |
Would it perhaps be more semantically correct to wrap the link to read the ToS and agreement checkbox in a fieldset? <fieldset>
<legend>Please review the terms of service and agree to them.</legend>
<p>
<a href="terms-and-conditions.html" target="_blank">Read our Terms and Conditions (opens in a new tab)</a>
</p>
<label for="tac">
<input id="tac" type="checkbox" name="terms-and-conditions" />
I agree to the Terms and Conditions
</label>
</fieldset> The fieldset effectively adds semantic linkage, not only proximity, to the expected operation. |
As the page says,
I don't think the link and input need a title, the link text and input labels are clear enough. Also, I assume the examples used in MDN articles are kept intentionally brief; a |
#33283 makes a good point about the current text potentially mischaracterizing the relationship between Here's are a couple of attempts at combining the two issues: Don't place additional interactive elements, such as {{HTMLElement("a", "anchors")}} or {{HTMLElement("button", "buttons")}}, inside a `label`. Doing so makes it difficult for people using a pointer to activate the form input associated with the `label`. Don't place additional interactive elements, such as {{HTMLElement("a", "anchors")}} or {{HTMLElement("button", "buttons")}}, inside a `label`. Doing so overlaps the hit areas of the interactive elements and the `label`, making it difficult for people using touch-screen devices or who have difficulty precisely controlling a cursor to activate right element. And then for the good example, at minimum I'd move the link to be before the checkbox instead of after. <p>
<a href="terms-and-conditions.html" target="_blank">Read our Terms and Conditions (opens in a new tab)</a>
</p>
<label for="tac">
<input id="tac" type="checkbox" name="terms-and-conditions" />
I agree to the Terms and Conditions
</label> While the |
MDN URL
https://developer.mozilla.org/en-US/docs/Web/HTML/Element/label
What specific section or headline is this issue about?
#Interactive content
What information was incorrect, unhelpful, or incomplete?
The recommended pattern to add interactive elements such as anchors or buttons after the label would mean that:
The recommendation seems to be worse than the pattern to avoid.
What did you expect to see?
Wouldn't it be better, given the current state of assistive tech tooling and web standards to include visually hidden context inside the label that indicates to users that an interactive element exists in the label versus the recommended alternative?
Do you have any supporting links, references, or citations?
Common sense as an avid keyboard user 😁.
Do you have anything more you want to share?
No response
MDN metadata
Page report details
en-us/web/html/element/label
The text was updated successfully, but these errors were encountered: