HTML5 input type=number and the placeholder attribute

Diogo Cardoso picture Diogo Cardoso · Feb 3, 2011 · Viewed 9.6k times · Source

Is there any way to use placeholder on <input type=number>?

Answer

Jeremy picture Jeremy · Mar 28, 2011

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.