1
<p id="demo">单击按钮后显示改变小时,分钟,秒后的一个日期。</p>
2
<button onclick="myFunction()">点我</button>
3
<script>
4
function myFunction() {
5
var d = new Date();
6
d.setUTCHours(15, 35, 1);
7
var x = document.getElementById("demo");
8
x.innerHTML = d;
9
}
10
</script>