A11y tips: placeholder can’t replace label

What do the specifications say about the placeholder?

The placeholder attribute represents a short hint (a word or short phrase) intended to aid the user with data entry when the control has no value. A hint could be a sample value or a brief descrip…


This content originally appeared on DEV Community and was authored by Carlos Espada

What do the specifications say about the placeholder?

The placeholder attribute represents a short hint (a word or short phrase) intended to aid the user with data entry when the control has no value. A hint could be a sample value or a brief description of the expected format.

For example:

<label for="email-address">Email</label>
<input
  type="email"
  id="email-address"
  name="email-address"
  placeholder="john.doe@example.com"
/>

The function of the placeholder attribute is very different from that of <label>: a label is a title of the form control and it must always be present, the placeholder is just a help hint in certain fields and it may or may not exist. Different elements to fulfill different functions.

So when you are doing the HTML of the forms, remember that: there is no case where placeholder can replace label.


This content originally appeared on DEV Community and was authored by Carlos Espada


Print Share Comment Cite Upload Translate Updates
APA

Carlos Espada | Sciencx (2021-12-22T07:22:39+00:00) A11y tips: placeholder can’t replace label. Retrieved from https://www.scien.cx/2021/12/22/a11y-tips-placeholder-cant-replace-label/

MLA
" » A11y tips: placeholder can’t replace label." Carlos Espada | Sciencx - Wednesday December 22, 2021, https://www.scien.cx/2021/12/22/a11y-tips-placeholder-cant-replace-label/
HARVARD
Carlos Espada | Sciencx Wednesday December 22, 2021 » A11y tips: placeholder can’t replace label., viewed ,<https://www.scien.cx/2021/12/22/a11y-tips-placeholder-cant-replace-label/>
VANCOUVER
Carlos Espada | Sciencx - » A11y tips: placeholder can’t replace label. [Internet]. [Accessed ]. Available from: https://www.scien.cx/2021/12/22/a11y-tips-placeholder-cant-replace-label/
CHICAGO
" » A11y tips: placeholder can’t replace label." Carlos Espada | Sciencx - Accessed . https://www.scien.cx/2021/12/22/a11y-tips-placeholder-cant-replace-label/
IEEE
" » A11y tips: placeholder can’t replace label." Carlos Espada | Sciencx [Online]. Available: https://www.scien.cx/2021/12/22/a11y-tips-placeholder-cant-replace-label/. [Accessed: ]
rf:citation
» A11y tips: placeholder can’t replace label | Carlos Espada | Sciencx | https://www.scien.cx/2021/12/22/a11y-tips-placeholder-cant-replace-label/ |

Please log in to upload a file.




There are no updates yet.
Click the Upload button above to add an update.

You must be logged in to translate posts. Please log in or register.