Placeholder hack for input[type="date"] element

1
2
<input type="date" name="dob" data-placeholder="Date of birth" required aria-required="true" />
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
There's no way to have placeholder text on input date elements, so here's a hack for it!

3 Responses

Multi-browser ?...
@Carlos Augusto Well... browser support for input type="date" itself is not that great yet :)
http://caniuse.com/#feat=input-datetime
Yes, I ask about that because usually inputs tags don't accept pseudo elements like 'before' e 'after'.

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.