how to give target="_Blank" on a button

Asked

Viewed 148 times

-5

wanted to know if I can put a target="_Blank" in this input

<input type="button" value="sobre" onclick="location.href='sobre.html'">

2 answers

0


<input type="button" value="sobre" onclick="window.open('http://google.com','_blank')" >
  • @Filipi, try this new way.

  • 1

    thank you very much, now it worked

  • formtarget="_blank"? Where’s that in the code? What does it do?

0

You must use the property target on the tag a.

Try to use like this:

<a href="sobre.html" target="_blank" />
  • look, I know this guy, but I’m looking for as a button but thanks for responding

  • @Filipi I think that answer would be the most plausible way. The way you want to do it and the other answer that was given, you end up using Javascript for something unnecessary. It could be done simply with target="_Blank". If a button does this, how about putting the button formatting in the tag <a>? I think it would be simpler.

Browser other questions tagged

You are not signed in. Login or sign up in order to post.