Up until last Thursday the date type input elements used to have a clear button (a cross or "x") next to them.
Now it looks like this:
Does anyone know what has changed? How can I get the clear button back?
We are using angular and Chrome as the browser.
The HTML code below shows the problem (when Chrome is used):
<label for="birthdaytime">Birthday (date and time):</label> <input type="datetime-local" id="birthdaytime" name="birthdaytime">
$('input[type=date]'). val(''); $('input[type=date]'). val('0000-00-00');
To clear an input field after submitting:Add a click event listener to a button. When the button is clicked, set the input field's value to an empty string. Setting the field's value to an empty string resets the input.
It was reported as a bug:
https://bugs.chromium.org/p/chromium/issues/detail?id=1087490#c1
https://bugs.chromium.org/p/chromium/issues/detail?id=1087501
And someone in the bug discussion suggested a workaround: add a button that will clear the date-local element value:
<input id=el type=datetime-local value="2025-07-01T12:44">
<button onclick="javascript:el.value=''">X</button>
https://jsfiddle.net/cxpt4r8b/
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