This content originally appeared on Stefan Judis Web Development and was authored by Stefan Judis
Accessible form inputs are essential for building an inclusive web. It's no news that input elements should come with a properly describing label. There are two HTML-native approaches to connect a label
element with an input
element.
<!-- reference the id of the input element -->
<label for="email">
Your email address
</label>
<input type="email" name="email" id="email">
<!-- wrap the input element with a label -->
<label>
Your email address
<input type="email" name="email">
</label>
I love the input-wrapping approach because I don't have to invent ids to connect a label with an input. Additionally, it increases the tab/click area of the wrapped input element, making it more accessible with an improved UX!
It would be such a beautiful solution if there wouldn't be the usual Frontend problem of supporting countless browsers, devices and assistive technologies such as screen readers.
Apparently, the Dragon speech recognition software is not supporting wrapping labels (Dragon product page), which means you still have to use for
/id
when wrapping your inputs.
<!-- wrapped input + for/id connection -->
<label for="email">
Your email address
<input type="email" name="email" id="email">
</label>
And that's it. This quick post's purpose is purely to have the links above at hand in the future, so that's it already. ?
If you want to read more about labels and input, have a look at Adrian Roselli's post My Priority of Methods for Labeling a Control.
Reply to Stefan
This content originally appeared on Stefan Judis Web Development and was authored by Stefan Judis
Stefan Judis | Sciencx (2021-07-08T18:30:00+00:00) Input-wrapping labels are not supported by Dragon (#note). Retrieved from https://www.scien.cx/2021/07/08/input-wrapping-labels-are-not-supported-by-dragon-note/
Please log in to upload a file.
There are no updates yet.
Click the Upload button above to add an update.