JSFiddle - React, Tailwind, and code Playground

HTML

So I got this<br>
<input id="created" type="text">

But how do I get this to become:

<input value="2017-03-07">

JavaScript

(function ($) {
  $(document).ready(function() {
    var now = new Date();
		var created = now.getFullYear() + '-' + (now.getMonth() + 1) + '-' + now.getDate();
    $('#created').val(created);
  });
})(jQuery);