代码编辑器:
x
1
<p id="demo">单击按钮按照UTC显示秒数:</p>
2
<button onclick="myFunction()">点我</button>
3
<script>
4
function myFunction(){
5
var d = new Date();
6
var x = document.getElementById("demo");
7
x.innerHTML=d.getUTCSeconds();
8
}
9
</script>
10