Window screenX and screenY Property - Open a new window with a specified left and top position, and return its coordinates: - Javascript Browser Object Model

Javascript examples for Browser Object Model:Window screenX screenY

Description

Window screenX and screenY Property - Open a new window with a specified left and top position, and return its coordinates:

Demo Code

ResultView the demo in separate window

<!DOCTYPE html>
<html>
<head>
<script>
function myFunction() {/*from   w w w .  j a v a 2s. c  o m*/
    var myWindow = window.open("", "myWin", "left=700, top=350, width=200, height=100");
    myWindow.document.write("<p>This is 'myWin'");
    myWindow.document.write("<br>ScreenX: " + myWindow.screenX);
    myWindow.document.write("<br>ScreenY: " + myWindow.screenY + "</p>");
}
</script>
</head>
<body>

<button onclick="myFunction()">Open "myWin"</button>

</body>
</html>

Related Tutorials