<html>
<body>
<p>单击该按钮可显示屏幕的颜色分辨率。</p>
<button onclick="myFunction()">试一试</button>
<p id="demo"></p>
<script>
function myFunction() {
var x = "颜色分辨率: " + screen.pixelDepth + " bits per pixel";
document.getElementById("demo").innerHTML = x;
}
</script>
</body>
</html>