Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

507
Views
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 answers
Answer question

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 Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!