Skip to content

Instantly share code, notes, and snippets.

@machida
Created June 16, 2012 08:43
Show Gist options
  • Select an option

  • Save machida/2940554 to your computer and use it in GitHub Desktop.

Select an option

Save machida/2940554 to your computer and use it in GitHub Desktop.
Add target _blank at link to other site.
$(document).ready ->
$("a[href^=http]").not("[href*=" + location.hostname + "]").attr "target", "_blank"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment