Javascript Browser Window open() Method Open a window and control its appearance

Introduction

Open a new window and control its appearance:

Click the button to open a new window with some specifications.

View in separate window

<!DOCTYPE html>
<html>
<body>
<button onclick="myFunction()">Test</button>
<script>
function myFunction() {//from  ww w .j a  v a 2  s .  co  m
  window.open("https://www.java2s.com", "_blank", "toolbar=yes,scrollbars=yes,resizable=yes,top=500,left=500,width=400,height=400");
}
</script>

</body>
</html>



PreviousNext

Related