try this
$(document).ready(function () {
var today = new Date();
var month = (today.getMonth() + 1).toString();
month = month.length == 1 ? "0" + month : month;
var day = today.getDate().toString();
day = day.length == 1 ? "0" + day : day;
var year = today.getFullYear();
var format = year + '-' + month + '-' + day
$("#a").val(format);
});