Here is the syntax used to open a new window. We can use the window.open method for opening new windows. All of the parameters that you pass in the open method are optional. If no parameters are passed, the browser opens a new about:blank window.

URL

The URL of the page to open in the new window. This parameter is optional.

Name

This parameter either specifies the target attribute or the name of the window. This parameter is optional. The following values are supported:

_blank – URL is loaded into a new window, default value_parent – URL is loaded into the parent window_self – URL replaces the current window_top – URL replaces any framesets that may be loadedname – The name of the window

Features

This set of parameters is used for most of the customization of the new window. More than one parameter can be passed by separating the list of values with a comma. This parameter is optional.

History

Specifies whether the URL creates a new entry or replaces the current entry in the history list. This parameter is optional. The following values are supported: true and false. With true, the URL replaces the current document in the history list. With false, the URL creates a new entry in the history list.

Example

Here is an example that can be used to open a small popup window.