[ jQuery ] Target Blank Links


/ Published in: JavaScript

Open a new window without using target="_blank" for XHTML 1.1.
Need jQuery Framework : http://jquery.com/


Copy this code and paste it in your HTML
  1. $('a[@rel$='external']').click(function(){
  2. this.target = "_blank";
  3. });
  4.  
  5. /*
  6.   Usage:
  7.   <a href="http://www.lepinskidesign.com.br/" rel="external">lepinskidesign.com.br</a>
  8. */

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.