xxxxxxxxxx
<!DOCTYPE html>
<html>
<title>JavaScript Window Screen示例 - 基础教程(div.cn)</title>
<body>
<p>单击按钮以显示屏幕的颜色深度:</p>
<button onclick="myFunc()">点我试试</button>
<p id="output"></p>
<script>
function myFunc() {
var x = "Color Depth: " + screen.colorDepth;
document.querySelector("#output").innerHTML = x;
}
</script>
</body>
</html>