Window open() Method
You can use JavaScript to launch a new window. The window.open() method, which allows you to open up new browser window without navigating away from the current page. It is useful when you need to display some popup advertisement or the instructions without navigating away from the current window. To open a new browser window, use the window.open() method. Syntax
window.open( sURL, windowName, "attributes");

<html>
<head>
<script type="text/javascript">
function newWindow() {
var newWindow = window.open("", "", "width=300, height=300");
}
</script>
</head>
<body>
<form>
<button onclick="newWindow()">Click here to open New Window</button>
</form>
</body>
</html>
In the above code, the return value , stored in the variable newWindow, is the reference to your new window. You can use this reference later, for example, to close this window (newWindow.close()), give focus to the window (newWindow.focus()) or perform other window manipulations.
The important Parameter of window.open() method are url, name, left, top, height and width. The other parameters are toolbar, menubar, scrollbars and resizable.

<html>
<head>
<script type="text/javascript">
function newWindow() {
var newWindow = window.open("https://net-informations.com", "_blank", "top=100, left=100, width=800, height=500, menubar=yes,toolbar=yes, scrollbars=yes, resizable=yes");
}
</script>
</head>
<body>
<form>
<button onclick="newWindow()">Click here to open New Window</button>
</form>
</body>
</html>
Normally only the first three arguments are used to open a new popup window in Javascript. It is important to note that the new window will not open if the user disabled the JavaScript in the browser, because various browser policies and user settings may prevent you from opening a popup window. Moreover now a days most browsers have a built in pop-up blocking software for blocking to abuse of the technique for marketing purposes.
Such types of Popup windows were overused and exploited by many websites during the earlier days of the web. This resulted in the later versions of browsers blocking popup windows . Eventually, popup windows became almost extinct now. Automatically opening popup windows is considered a very bad practice nowadays.
Related Topics
- JavaScript Popup Boxes
- How to Create Drop-Down Lists in JavaScript
- How do I include a JavaScript file in another JavaScript file?
- Print the content of a Div using JavaScript/jQuery
- How to get the current URL using JavaScript ?
- How to Detect a Mobile Device with JavaScript/jQuery
- How to validate an email address in JavaScript
- JavaScript Array Iteration
- How to Remove a Specific Item from an Array in JavaScript
- What is JavaScript closures?
- How To Remove a Property from a JavaScript Object
- How to get selected value from Dropdown list in JavaScript
- How do I get the current date in JavaScript?
- How to Open URL in New Tab | JavaScript
- How to delay/wait/Sleep in code execution | JavaScript
- How to round to at most 2 decimal places | JavaScript
- How to convert string to boolean | JavaScript
- How to check undefined in JavaScript?
- How To Copy to Clipboard | JavaScript
- How to encode a URL using JavaScript?
- How to force Input field to enter numbers only | JavaScript
- How to create multiline string in JavaScript
- How to Check for an Empty String in JavaScript?