Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

508
Visualizações
How to make whole html input type date field clickable for calendar popup?

In the HTML input type date field when we click on an icon, the calendar is popup. But I want to make it pop up when we click in the dd/mm/yyyy field? I want to make calendar popup when clicked on this marked field

about 4 years ago · Juan Pablo Isaza
1 Respostas
Responde à pergunta

0

Listen for the focus event on the element, then invoke the HTMLInputElement.showPicker() method:

document.getElementById("datePicker").addEventListener('focus', function(event) {
  event.target.showPicker();
});
<input type="date" id="datePicker" />

Note: Unfortunately this doesn't work in the snippet above due to the restrictions of calling showPicker() cross-origin combined with the cross-origin implications of the Stack Snippets feature itself, but should work in practice.

However, you should consider that this particular method has relatively abysmal support (only ~66% of all browsers implement it as of this writing).

about 4 years ago · Juan Pablo Isaza Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda