How do you programmatically clear HTML5 date fields?

后端 未结 10 1282
我在风中等你
我在风中等你 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:48

    $("input[type=date]").val("") works for me in chrome. It sets the input field to dd/mm/yyyy.

    Maybe it's browser specific. Most browsers have only partial or no support for this input: http://caniuse.com/input-datetime

提交回复
热议问题