1
<p id="demo">单击按钮显示修改一个月中某天后的日期:</p>
2
<button onclick="myFunction()">点我</button>
3
<script>
4
function myFunction() {
5
var d = new Date();
6
d.setDate(15);
7
var x = document.getElementById("demo");
8
x.innerHTML = d;
9
}
10
</script>