title: Using Javascript to input time in HTML5 time field
body: <p>I'm trying to create a function in JS that will fill in the html5 <code>&lt;input type=time&gt;</code> with a format like this <code>hh:mm:ss</code>. </p>
  
  <pre><code>function timeChange(){
  var d = new Date();
  d.getHours();
  d.getMinutes();
  d.getSeconds();
  
  var hours = d.getHours();
  var minutes = d.getMinutes();
  var seconds = d.getSeconds();
  
  document.getElementById("time_in").value = (....);
  }
  </code></pre>
  
  <p>I'm not sure how to code the .value for this. I've tried using <code>.value = (hours":"minutes":"seconds);</code> but that just gives me a compile error. </p>
  
  <p>Anyone got ideas? I just need it in hh:mm:ss. </p>
  
  <p>HTML5 code:</p>
  
  <pre><code> &lt;button type="button" onClick="timeChange()"&gt;Time&lt;/button&gt;
  
   &lt;input id="time_in" type="time" name="time_in"&gt;
  </code></pre>