0

let dueDate = document.getElementById('dueDate')
dueDate.innerHTML = "date"
  <input type="date" id="dueDate" placeholder="Date" class="dueDate"></input>

I have this simple input field of date, and instead of the outside looking like "yyyy-mm-dd" I want it to display "date" and when a date is picked it then displays the date,

Lee Taylor
  • 7,761
  • 16
  • 33
  • 49

1 Answers1

0

The placeholder doesn’t work for date type input so you can use onfocus() inside text input field

<input type=“text” placeholder=“date” onFocus=“this.type=date”>

Sana
  • 153
  • 1
  • 2
  • 13