Delete mm / dd / yyyy at the date of entering the placeholder type

We have an input date like text input. So we need to place, so we tried like this

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

Now it shows the placehoder "Date". Then I click on it, showing mm/dd/yyyy . Then click on it, indicating the "Date" field. But no need to show mm/dd/yyyy . After you click on the text field with an open opening.

+5
source share
1 answer

As described in previous discussions, you cannot set the value to empty for a JavaScript Date object. For more information, refer to: How to initialize java.util.date for empty


However, you can set default values ​​for a valid date. Refer to How to Set a Date Value for more information.

0
source

Source: https://habr.com/ru/post/1262140/


All Articles