Skip to content

Commit

Permalink
Placeholders supplementary, warn against polyfill
Browse files Browse the repository at this point in the history
  • Loading branch information
zachleat committed Oct 15, 2012
1 parent 4580b23 commit bd42b7c
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion posts/input-placeholder.md
@@ -1,9 +1,14 @@
feature: input[placeholder]
status: use
status: caution
tags: gtie9
kind: html
polyfillurls:[Placeholder jQuery Plugin](https://github.com/mathiasbynens/jquery-placeholder)

Input placeholders are simply ignored in IE 9 and below. Note that they are only applied when the **type** of the input is *text*, *password*, *search*, *tel*, *url*, or *email*. *Textareas* can have placeholders, too. Otherwise, it is ignored.

Per the [HTML specification](http://dev.w3.org/html5/spec/Overview.html#the-placeholder-attribute):
> The placeholder attribute represents a short hint (a word or short phrase) intended to aid the user with data entry. A hint could be a sample value or a brief description of the expected format. The placeholder attribute should not be used as an alternative to a label.
`input[placeholder]` is commonly the first polyfill anyone writes and, as such, there are [many of them](http://bit.ly/polyfills). Password inputs and submit event clearing are among many of the gotchas that catch naive implementations; Mathias's polyfill below handles these cases very well.

That said, a properly implented form should have labels and any placeholders should be supplementary. As such, they are not required for successful completion of a form and use of a polyfill is likely unwarranted.

1 comment on commit bd42b7c

@nimbupani
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks great! Can you remove the polyfillurls meta value from the file? Given we are suggesting people do not use the polyfills.

Also I think we should strongly recommend use, given this is supplementary, so their presence or absence shouldn't have an impact?

Please sign in to comment.