title: how to print date in input text box in html
body: <p>here is my code,i want to print date in text box after enter date text using onload event.</p>
  
  <pre><code>&lt;!DOCTYPE html&gt;
  &lt;html&gt;
     &lt;head&gt;
        &lt;script&gt;
           function displayDate() {
              document.getElementById("fname").value = Date();
           }
        &lt;/script&gt;
     &lt;/head&gt;
     &lt;body onload="displayDate()"&gt;
        Enter date: &lt;input type="date" id="fname" readonly /&gt;
     &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>