1
<p id="demo">单击按钮显示修改后的秒数和毫秒数:</p>
2
<button onclick="myFunction()">点我</button>
3
<script>
4
function myFunction() {
5
var d = new Date();
6
d.setSeconds(35, 825);
7
var s = d.getSeconds();
8
var ms = d.getMilliseconds();
9
var x = document.getElementById("demo");
10
x.innerHTML = s + ":" + ms;
11
}
12
</script>