Jump to content


Photo

button click and open link in new window


  • Please log in to reply
3 replies to this topic

#1 hvle

hvle
  • Members
  • PipPipPip
  • Advanced Member
  • 667 posts
  • Locationmelbourne, Australia

Posted 14 August 2006 - 07:52 AM

hi guys,

I have a button like this:
<input type="button" value="view post" onClick="document.location.href='http://google.com';">

when click on this button, it will surf to google.com
however, I also want it to open google in a new window.

thanks
Life's too short for arguing.

#2 ToonMariner

ToonMariner
  • Members
  • PipPipPip
  • Advanced Member
  • 3,342 posts
  • LocationNewcastle upon Tyne, UK

Posted 16 August 2006 - 11:40 PM

Tell Miek to pay me and I'll help you ;) Christ its only $100
follow me on twitter @PHPsycho

#3 Ifa

Ifa
  • Members
  • PipPipPip
  • Advanced Member
  • 88 posts
  • LocationRauma, Finland

Posted 18 August 2006 - 12:00 PM

target="_blank"
I'm just a guy who likes to code for fun...

#4 ToonMariner

ToonMariner
  • Members
  • PipPipPip
  • Advanced Member
  • 3,342 posts
  • LocationNewcastle upon Tyne, UK

Posted 18 August 2006 - 08:27 PM

just use an anchor...

<a href="http://google.com" target="_blank">view foobar</a>
follow me on twitter @PHPsycho




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users