<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>W3Cschool教程(w3cschool.cn)</title>
</head>
<body>
<p id="demo">单击按钮返回一周的某天(UTC)。</p>
<button onclick="myFunction()">点我</button>
<script>
function myFunction(){
var d = new Date();
var x = document.getElementById("demo");
x.innerHTML=d.getUTCDay();
}
</script>
<p><strong>注意:</strong> 0=周日, 1=周一, 类推。</p>
</body>
</html>