Skip to content
Advertisement

How to reset a date in Firefox input[type=date]?

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: enter image description here

In order to get this result:

enter image description here

My jQuery code:

JavaScript

I tested:

  • val(“”)
  • val(null)
  • val(“0000-00-00”)
  • val( new Date() )

without any success… is there a solution?

Advertisement

Answer

To set an input element’s value use the jQuery function elem.val("..."):

JavaScript
JavaScript
JavaScript
User contributions licensed under: CC BY-SA
10 People found this is helpful
Advertisement