Window open() Method | js new page
❮WindowObject[1]ExampleOpen"www.w3schools.com"inanewbrowsertab:window.open("https://www.w3schools.com");TryitYourself»[2]More"TryitYourself"examplesbelow.DefinitionandUsageTheopen()methodopensanewbrowserwindow,oranewtab,dependingonyourbrowsersettingsandtheparametervalues.Tip:Usetheclose()[3]methodtoclosethewindow.BrowserSupportMethodopen()YesYesYesYesYesSyntaxwindow.open(URL,name,specs,replace)ParameterValuesParameterDescriptionURLOptional.SpecifiestheURLofthepagetoopen.IfnoURLisspecified,an...
❮ Window Object[1]
ExampleOpen "www.w3schools.com" in a new browser tab:
window.open("https://www.w3schools.com");
Try it Yourself »[2]More "Try it Yourself" examples below.
Definition and UsageThe open() method opens a new browser window, or a new tab, depending on your browser settings and the parameter values.
Tip: Use the close()[3] method to close the window.
Browser Support Method open() Yes Yes Yes Yes Yes Syntaxwindow.open(URL, name, specs, replace)
Parameter Values Parameter Description URL Optional. Specifies the URL of the page to open. If no URL is specified, a new window/tab with about:blank is opened name Optional. Specifies the target attribute or the name of the window. The following values are supported: _blank - URL is loaded into a new window, or tab. This is default _parent - URL is loaded into the parent frame ...