How to display the menuContextual of an input type="datatime-local" with JavaScript

0

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?

    
asked by Daniel Enrique Rodriguez Caste 16.08.2017 в 01:22
source

1 answer

0

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>
    
answered by 16.08.2017 / 01:50
source