Anoop
Anoop

Reputation: 23208

How to open a link in new window with tab enabled

I search a lot but could not figured it out.

Is it possible to open a new window with tab enabled using window.open() method?. The way chrome context menu "open link in new window" works.

Upvotes: 3

Views: 234

Answers (3)

Lalit Guglani
Lalit Guglani

Reputation: 46

Use this code

window.open("http:.//www.google.com","DemoName",'scrollbars=1,height=650,width=1050');

Upvotes: 0

jbabey
jbabey

Reputation: 46647

using an anchor tag you can set the target attribute to have some control over where the link opens. Other than that, this behavior is up to the browser and user and cannot be controlled by javascript.

Upvotes: 1

Jonas G. Drange
Jonas G. Drange

Reputation: 8845

The browser decides on its own how links will open. Sometimes a user can configure how links are to be opened, but the web page cannot do this.

Upvotes: 7

Related Questions