Not showing a placeholder for input type=“date” field with HTML5. How to solve it?

HTMLWeb DevelopmentFront End Technology

To show it, use the following −

<input placeholder = "Date" class = "textbox-n" type = "text" onfocus = "(this.type = 'date')"  id = "date">

You can also go for CSS −

input[type="date"]::before{
   color: #ffffff;
   content: attr(placeholder) ": ";
}
input[type="date"]:focus::before {
   content: "" !important;
}
raja
Published on 21-Mar-2018 09:43:24
Advertisements