Open a window and resize in JavaScript

Description

The following code shows how to open a window and resize.

Example


<!--  ww w  .  j  a  v a 2 s  . c o  m-->
<!DOCTYPE HTML>
<html>
<body>
<script type="text/javascript">

var java2sWin =window.open("http://www.java2s.com/","myWindow");
java2sWin.resizeTo(500, 500);
java2sWin.moveTo(100, 100);

</script>
</body>
</html>

Click to view the demo

The code above generates the following result.

Open a window and resize in JavaScript