: I love this and I tot...">

How to invoke date picker from input date in javascript?

Chrome has its own date picker for <input type="date">

: date picker for date input in chrome

I love this and I totally agree that it only works in chrome.

Question: how can I call the date picker for this input field in javascript?

Usually there is only an input field until the user focuses it and presses the small black triangle to open the small calendar. I want to open it from javascript.

I would like to avoid implementing third party dates if possible.

I've tried element.focus()

, element.click()

etc.

+3


source to share


1 answer


I understood that.

The trick is to dispatch the F4 keyboard event.



See my answer to a (really) duplicate question here for details

+1


source







All Articles