<html>
<body>
<p>单击按钮可显示更改为上个月最后一天后的日期。</p>
<button onclick="myFunction()">试一试</button>
<p id="demo"></p>
<script>
function myFunction() {
var d = new Date();
d.setUTCDate(0);
document.getElementById("demo").innerHTML = d;
}
</script>
</body>
</html>