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

110
Views
How to set default date to today in input type date in Html 5?

I am implementing a Booking form where I want the date to be set to default to today . It should also be shown as a placeholder in the input. Is there any way it can be possible in HTML5.

<input type="date" name="from" value="" id="date" class="ajaxField required"/>                  
about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

I think there is no way to do this using pure HTML, but you can use a simple js script:

HTML:

<head>
<script src="script.js" defer></script>
</head>
<body>
    <form>
        <input id="time">
    </form>
</body>

JS:

const time = document.getElementById("time")
let today = new Date();
time.placeholder=today.toString().slice(4, 10)
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!