Firefox v57.0.1 supports the attribute "date" for the HTML input tag.
I would like in jQuery to reset the date value when the user click on a radio button like this:
In order to get this result:
My jQuery code:
$("input[name=f_foo_duration]").click(function() {
if ($("#f_foo_duration_until").is(':checked')) {
$("#f_foo_duration_date").attr("readonly", false);
}else{
$("#f_foo_duration_date").attr("readonly", true);
$("#f_foo_duration_date").attr( "value", new Date() ); <-- here
}
});
I tested:
- val("")
- val(null)
- val("0000-00-00")
- val( new Date() )
without any success... is there a solution?