Question
How to trigger event on input date select when value is unchanged?
I am pre-selecting a date on <input type='date' />
and want the user to select a date anyway. If the date selected is the same as the pre-selected value, it does not trigger the change
event in jQuery.
Also tried blur
and input
, but on blur
only activates when losing the focus of the element, not on date selection. On input
seems to have the same result as on change
.
Any ideas how to achieve this?
The pre-selected date is a suggested date which can be chosen or another date could be chosen.
<input id="my-date" type="date" value="2024-07-20" />
// ..
$( '#container' ).on( 'change', '#my-date', function()
{
console.log( 'selected date: ' + $( this ).val() );
});
2 104
2