title: JavaScript Input Date Replace Field (mm/dd/yyyy) with Current Date
body: <p>So I created a date input field where the field box displays the date, but as default it displays (mm/dd/yyyy) and I was wondering if you can replace this with the current date...</p>
  
  <p>I've looked at other questions and it didn't really help much. I put this block of code under the <code>&lt;script&gt;</code> tag. And it still didn't replace the (mm/dd/yyyy) text in the field. How can I do this or if it is possible.</p>
  
  <pre><code>function getTodaysDate() {
      var today = new Date();
      var dd = today.getDate();
      var mm = today.getMonth()+1; //January is 0!
  
      var yyyy = today.getFullYear();
      if(dd&lt;10){
           dd='0'+dd
      } 
      if(mm&lt;10){
           mm='0'+mm
      } 
      var today = dd+'/'+mm+'/'+yyyy;
      document.write(today);
  }
  
  &lt;p&gt;
     Date: &lt;input type="date" name="currentDate" id="currentDate" value="currentDate();"/&gt;
  &lt;/p&gt;
  </code></pre>