Skip to content

Instantly share code, notes, and snippets.

@ArupSen
Created July 11, 2012 10:06
Show Gist options
  • Save ArupSen/3089412 to your computer and use it in GitHub Desktop.
Save ArupSen/3089412 to your computer and use it in GitHub Desktop.
Use inline javascript onclick to open link in new window or tab
<a href="http://www.bigmustard.co.uk/models/view/dik-cadbury/622" title=" Dik's profile at Mustard Casting in a new window" onclick="window.open('http://www.bigmustard.co.uk/models/view/dik-cadbury/622');return false">Mustard Models</a>
@ArupSen
Copy link
Author

ArupSen commented Jul 11, 2012

This is an alternative method to the target="_blank" using inline javascript. The return false means that the link won't load in the original window or tab.

@omzi
Copy link

omzi commented Jun 25, 2018

Thanks! Really helped with this project that I was working on

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment