title: Change date from YYYYMMDD to YYYY-MM-DD Javascript
body: <p>I'm trying to convert a string from my database that is formatted as YYYYMMDD and is placed in the input box <code>id="startingdate"</code>. How would I convert it to YYYY-MM-DD at the other input box <code>id="startingdate1"</code>?</p>
  
  <pre><code>&lt;input type="" id="startingdate1" name="startingdate1" size="20" class="form-control col-md-7 col-xs-12" placeholder="YYYY-MM-DD"/&gt;
  &lt;input id="startingdate" name="startingdate" type="hidden"/&gt;
  </code></pre>