forked from h5bp/html5please
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Placeholders supplementary, warn against polyfill
- Loading branch information
Showing
1 changed file
with
6 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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. |
bd42b7c
There was a problem hiding this comment.
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?