Is there any way to use placeholder on <input type=number>
?
I've just checked against the HTML5 spec for input where a type is number and it explicitly says that the placeholder attribute may not be used. I also had errors with http://validator.w3.org when I tried to validate html with an input type of number with a placeholder attribute. Looks like browsers may support this but it's not valid in the HTML5 spec.
@zachleat is correct, the placeholder
attribute is allowed in the latest HTML5 spec:
HTML 5.1 2nd Edition: forms, number-state-typenumber (see the bookkeeping section)
The following common input element content attributes apply to the element: autocomplete, list, max, min, placeholder, readonly, required, and step content attributes;
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With