代码示例:(标识:jsck_win_screenx_1)
<!DOCTYPE html>
<html>
<body>

<h1>Window 对象</h1>

<h2>screenX 和 screenY 属性</h2>

<button onclick="myFunction()">打开窗口</button>

<p id="demo"></p>

<script>
function myFunction() {
const myWin = window.open("", "", "left=700, top=350, width=200, height=100");
let x = myWin.screenX;
let y = myWin.screenY;
document.getElementById("demo").innerHTML =
"myWin.screenX= " + x + "<br>myWin.screenY= " + y; 
}
</script>

</body>
</html>
运行结果: