javascript - Can the default value of type="date" be changed to today's date?
仅有的幸福
仅有的幸福 2017-05-16 13:42:59
0
2
693

Use h5 input type="date" to write date selection, but you want the default value to be displayed as the current year, month and day. How to achieve this?

Additional:
I have obtained the date of the day through js, and can also assign it to the input of type="date", but the current date is not displayed on the interface. Question: How can I display the current date by default on the interface?

仅有的幸福
仅有的幸福

reply all(2)
过去多啦不再A梦

It seems impossible to achieve using pure html.

It’s very simple to use js: get the current time and then pass it in to the form.

大家讲道理

var i='2017-04-20'
$('input[type="date"]').val(i)

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template