Add A Placeholder To A Number Input

Posted by Weston Ganger

I needed to add a placeholder to a number input. Apparently this is only supported in Chrome.


The solution I found was to start with a text input with a placeholder and then on focus change it to a number.


<input placeholder="Amount" onfocus="this.type = 'number';">

So it will now have a placeholder until the input comes into focus.


Related External Links:

Article Topic:Software Development - HTML / CSS

Date:April 07, 2016

Recommended Posts

Contact

604-309-8713
info@solidfoundationwebdev.com

Send Me A Message

I would love to get in touch and talk about your next project. Feel free to send a message and I will get back to you shortly.

Get Connected