Playgrounds
Snippets
Developers
Compiler
All
ActionScript
Ajax
AngularJS
Apache
AppleScript
ASP.NET
Bash
C
C#
C++
Coffee
CoffeeScript
ColdFusion
Command
CSS
Delphi
Django
ES6
GLSL
Grunt
Gulp
HAML
Haskell
HTML
iOS
Jade
Java
JavaScript
jQuery
JSX
Less
LUA
MDX
MySQL
Objective
Other
Pascal
Perl
PHP
Plain text
PowerShell
Processing
Progress
Prolog
Pseudocode
Python
Rails
RegExr
Ruby
SASS
Scala
Scheme
SCSS
SmallBASIC
Smarty
SQL
Stylus
SVG
Swift
TypeScript
VHDL
X++
XHTML
XML
Xojo
XSLT
New snippet
New playground
Sign up
Login
Upload
Playgrounds
Snippets
Developers
Sign up
Login
Placeholder hack for input[type="date"] element
CSS
by
Gentle Media
11th January 2016
1
2
<
input
type
="
date
"
name
="
dob
"
data-placeholder
="
Date
of
birth
"
required
aria-required
="
true
" />
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
latest revision
2
1
There's no way to have placeholder text on input date elements, so here's a hack for it!
3 Responses
Multi-browser ?...
0
Reply?
CA
Carlos Augusto
8 years ago
@Carlos Augusto
Well... browser support for input type="date" itself is not that great yet :)
http://caniuse.com/#feat=input-datetime
0
Reply?
Gentle Media
8 years ago
Yes, I ask about that because usually inputs tags don't accept pseudo elements like 'before' e 'after'.
0
Reply?
CA
Carlos Augusto
8 years ago
Write a comment
Send Comment
You can use [html][/html], [css][/css], [php][/php] and
more
to embed the code. Urls are automatically hyperlinked. Line breaks and paragraphs are automatically generated.
3 Responses
http://caniuse.com/#feat=input-datetime
Write a comment
You can use [html][/html], [css][/css], [php][/php] and more to embed the code. Urls are automatically hyperlinked. Line breaks and paragraphs are automatically generated.