From the course: Accessibility for Web Design

Unlock the full course today

Join today to access over 23,200 courses taught by industry experts.

The placeholder attribute

The placeholder attribute

- The placeholder is a relatively recent addition to the HTML tools we have available to us. It is supposed to be used to provide a hint on how to fill out certain form fields. You can use a placeholder to show a date format, for example. Here's how we use it. We use the placeholder here in the Start Date field to show that we want the format to be MM/DD/YYYY. One of the challenges though is that the placeholder disappears as soon as you start typing. The fact that we've got a useful piece of information in the placeholder that disappears makes it a little bit less useful. It can have a pretty significant impact on someone with literacy or memory related issues. One of the techniques we use to make it a little more useful is to make the placeholder persist. When we place focus in the field and start typing, we take the value of the placeholder and append it to the existing label. That ensures that it'll help everyone.…

Contents