Remove placeholder from date type input in chrome [duplicate]
You could achieve a nice effect using onfocus
and onfocusout
, along with some CSS.
<input name="date" type="text" onfocus="(this.type='date')" onfocusout="(this.type='text')">
You can hide the format placeholder with the following style rule:
<style>::-webkit-datetime-edit-year-field:not([aria-valuenow]),::-webkit-datetime-edit-month-field:not([aria-valuenow]),::-webkit-datetime-edit-day-field:not([aria-valuenow]) { color: transparent;}</style><input type=date>