jQuery rel=\"external\" to open links in new window

/ Published in: jQuery
Save to your folder(s)

Add attribute to links to open them in a new window. Example - rel="external". Alternative to target="_blank", conforming to XHTML specification.

Copy this code and paste it in your HTML
  1. $('a[rel*=external]').click(function() {
  2. window.open(this.href);
  3. return false;
  4. });

URL: http://darrenhuskie.com/

Report this snippet


RSS Icon Subscribe to comments

You need to login to post a comment.