I have a <input id="miInput" type="datetime-local">
and I need to display the calendar to select a date but pressing a <button id="miBoton"> Mi Boton </button>
. What event can I use to display this contextual menu?
I have a <input id="miInput" type="datetime-local">
and I need to display the calendar to select a date but pressing a <button id="miBoton"> Mi Boton </button>
. What event can I use to display this contextual menu?
Can not. There is no standard API since all browsers implement it in their own way. The only thing you can do is focus
to the element or use some bootstrap plugin .
Example focus:
<input type="datetime-local">
<button onclick="document.querySelector('input').focus()">abrir</button>