how to have an open date picker in html

Viewed 1224

i have the following date picker, which works as bellow

<input type="date" id="start" name="trip-start"
       value="2018-07-22"
       min="2018-01-01" max="2018-12-31">

as you can see you have to click on the input box for the drop down calendar to open. How can i have the dropdown calendar always open instead of having to click on the input box.i just want the calendar to show as follows.i dont want to show the input box, i want to get the date clicked from the calendar and i will pass it to another function

calendar

1 Answers

You can always do this with jQuery. But it is not recommended to keep this opened. Try creating calender with manual HTML CSS and do anything with it.

Still if you want to do this.

You'll need HTML something like:

<input id="my-input">

and the following JavaScript:

$input = $("#my-input");
$input.datepicker();
$input.data('datepicker').hide = function () {};
$input.datepicker('show');

Here is link.

Related