Javascript Browser Window open() Method open a window with width and height

Introduction

Open an about:blank page in a new window/tab:

var myWindow = window.open("", "", "width=200,height=100");

Click the button to open an about:blank page in a new browser window that is 200px wide and 100px tall.

View in separate window

<!DOCTYPE html>
<html>
<body>
<button onclick="myFunction()">Test</button>

<script>
function myFunction() {/*from ww w  . j  a  v a2s. co  m*/
  var myWindow = window.open("", "", "width=200,height=100");
}
</script>

</body>
</html>



PreviousNext

Related