How do you programmatically clear HTML5 date fields?

后端 未结 10 1278
我在风中等你
我在风中等你 2020-12-11 16:18

I\'m looking for a way to programmatically clear HTML5 date fields with Javascript (specifically jQuery). So far I have tried two methods which I thought obvious:

         


        
10条回答
  •  我在风中等你
    2020-12-11 16:29

    document.getElementById("datePicker").valueAsDate = null;
    

    this line of code works with my browser (chrome) , didn't tested in other browsers

提交回复
热议问题