How to change the mask of an input type date

-8

How do I solve this problem?

I want to remove this "dd / mm / yyyy"

Iwanttoremovethis"dd / mm / yyyy"

    
asked by anonymous 11.05.2018 / 15:29

1 answer

1

You can "hide" the mask by setting the color of the default text to transparent, and then putting it in the black color back when input is focused or valid. It worked in Chrome and in FireFox, IE does not seem to accept type=date , but that way it is also empty and when you click on input or write something the text turns black.

input[type=date]::-webkit-datetime-edit{ color: transparent; }
input[type=date]:valid::-webkit-datetime-edit{ color: #000; }
input[type=date]:focus::-webkit-datetime-edit{ color: #000; }

input[type=date]{ color: transparent; }
input[type=date]:valid{ color: #000; }
input[type=date]:focus{ color: #000; }
<input type="date" required>
    
11.05.2018 / 16:13