title: Change date in input type date HTML
body: <p>I have a problem. I want to change the date in the input field to the current date. Here is my code:</p>
  
  <pre><code>&lt;input type="date" id="datum currentdate"&gt;
  </code></pre>
  
  <pre class="lang-js prettyprint-override"><code>$(document).ready( function() {
      var now = new Date();
      var day = ("0" + now.getDate()).slice(-2);
      var month = ("0" + (now.getMonth() + 1)).slice(-2);
      var today = now.getFullYear()+"-"+(month)+"-"+(day) ;
      $('#currentdate').val(today);
  });
  </code></pre>
  
  <p>But this doesn't work. I have included jQuery. Does anyone know a solution for this problem?</p>