var d = new Date('2018-03-31'); d.setMonth(d.getMonth() + 1, 1); dt = new Date(d); document.getElementById("demo").innerHTML = dt;