An Interest In:
Web News this Week
- April 2, 2024
- April 1, 2024
- March 31, 2024
- March 30, 2024
- March 29, 2024
- March 28, 2024
- March 27, 2024
August 29, 2017 02:43 pm GMT
Original Link: https://css-tricks.com/prefilling-date-input/
Prefilling a Date Input
HTML has a special input type for dates, like this: <input type="date">
. In supporting browsers (pretty good), users will get UI for selecting a date. Super useful stuff, especially since it falls back to a usable text
input. But how do you set it to a particular day?
To set a particular day, you'll need to set the value
to a YYYY-MM-DD format, like this:
<input type="date" value="1980-08-26">
Minor note: placeholder
won't do anything in a browser …
Prefilling a Date Input is a post from CSS-Tricks
Original Link: https://css-tricks.com/prefilling-date-input/
Share this article:
Tweet
View Full Article