Accessibility First DevRel. I focus on ensuring content created, events held and company assets are as accessible as possible, for as many people as possible.
One thing to note that may not be clear, although a <button> is labelable, the label should not be set with the <label> element (the text inside the button is the label).
Similarly if for some reason you are using <input type="button"> then the value attribute is treated as the label and a <label> element should not be used.
Using a <label> can actually make accessibility worse for <button> elements!
Given the subject of the post being focused on the <label> element I thought that was an important distinction.
Accessibility First DevRel. I focus on ensuring content created, events held and company assets are as accessible as possible, for as many people as possible.
I could tell from the accuracy it was more of an unintended implication than anything else. One of the most accurate and complete articles I have read on labels as they all forget voice etc.
I look forward to the next instalment!
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
Great and detailed article! ❤ and 🦄 from me!
One thing to note that may not be clear, although a
<button>
is labelable, the label should not be set with the<label>
element (the text inside the button is the label).Similarly if for some reason you are using
<input type="button">
then thevalue
attribute is treated as the label and a<label>
element should not be used.Using a
<label>
can actually make accessibility worse for<button>
elements!Given the subject of the post being focused on the
<label>
element I thought that was an important distinction.Thanks @inhuofficial for the great reply! I'll change the post to include this as well, totally missed this while I was writing the post! :-)
I could tell from the accuracy it was more of an unintended implication than anything else. One of the most accurate and complete articles I have read on labels as they all forget voice etc.
I look forward to the next instalment!