Resize a window in JavaScript

Description

The following code shows how to resize a window.

Example


<!DOCTYPE HTML>
<html>
<body>
<script type="text/javascript">
<!--  ww w  .ja  v a  2  s.  c  o  m-->
//resize to 100 x 100
window.resizeTo(100, 100);
//resize to 300 x 300
window.resizeTo(300, 300);
//resize to 200 x 150
window.resizeBy(100, 50);

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

Click to view the demo

The code above generates the following result.

Resize a window in JavaScript