Skip to content

Instantly share code, notes, and snippets.

@plavet
Created May 16, 2012 03:10
Show Gist options
  • Save plavet/2707013 to your computer and use it in GitHub Desktop.
Save plavet/2707013 to your computer and use it in GitHub Desktop.
Jquery - Open in new window using rel
//Open link in new tab
$("a[rel^='external']").click(function(){
this.target = "_blank";
});
// Usage:
// <a href="#" rel="external">#</a>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment