3

So, this is my code:

function link1() { window.location.href="Example"; }

How do i achieve the _blank function in JS?

Cheers

(Note: I am not using a library, nor am i intending to atm)

1
  • @isherwood: No, this doesn't relate to attributes. That's just the OP's title steering you off. Commented Jan 29, 2014 at 18:27

1 Answer 1

3

window.open will do the trick.

function link1()
{ 
   window.open("http://www.example.com");
}
Sign up to request clarification or add additional context in comments.

1 Comment

Indeed. Provided this is called during the processing of a user-initiated event (otherwise, the pop-up blocker will do its job).

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.