I wish to use the new input attribute from HTML5 DATE, only one problem, in the logic of the project, the user must be have the choice to delete the value, but i don't see, how to set empty value on this inputs
How do you reset input date? $('input[type=date]'). val(”); $('input[type=date]'). val('0000-00-00');
Approach: First, we need to write the code for input, and we need to give its type as the date in the HTML file. Then in-order to restrict the user to enter the date manually we can use onkeydown event. In the onkeydownevent we need to return false so that we can restrict the user to enter the date manually.
Assuming you want to make the value shown to dd/mm/yyyy
, then click on Clear
button.
In HTML5 on Chrome the date picker popup has a "clear" button at the bottom (next to "today")
<input type="date" value="">
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With