window.open(URL, name, specs, replace)
Parameters: This method accepts four parameters as mentioned above and described below:
- URL: It is an optional parameter. It is used to set the URL of web pages that need to open. If URL is not set then window.open() method open a blank window.
- name: It is an optional parameter and is used to set the window name.
- specs: It is an optional parameter used to separate the item using a comma.
- replace: It is an optional parameter and used to specify the URL URL creates a new entry or replaces the current entry in the history list. This parameter returns a boolean value. If this parameter returns true then URL replaces the current document in the history list and if returns false then URL creates a new entry in the history list.
Return Value: This method creates a new window.
Window.close(): This method is used to close the window which is opened by the window.open() method.
Parameters: This method does not contain any parameters.
Return Value: This method does not return any value.
Supported Browser: The browsers are supported by the window.open() & window.close() method are listed below:
- Chrome version 1 and above
- Edge version 12 and above
- Firefox version 1 and above
- Internet Explorer version 4 and above
- Opera version 3 and above
- Safari version 1 and above
HTML is the foundation of web pages and is used for webpage development by structuring websites and web apps. You can learn HTML from the ground up by following this HTML Tutorial and HTML Examples.
Please Login to comment...