Return to Snippet

Revision: 10262
at January 27, 2009 04:13 by gfazioli


Updated Code
/**
 * From jQuery 1.3+ release, avoid (at) char
 */
jQuery('a[target=_blank]').addClass('external');

/**
 * Before jQuery 1.3 release
 */
jQuery('a[@target=_blank]').addClass('external');
//
/**
 * css

.external{background:url(images/external.png) no-repeat right 3px;padding-right:14px}

*/

Revision: 10261
at December 15, 2008 06:29 by gfazioli


Initial Code
jQuery('a[@target=_blank]').addClass('external');
//
/**
 * css

.external{background:url(images/external.png) no-repeat right 3px;padding-right:14px}

*/

Initial URL
http://www.undolog.com/2008/12/15/very-short-snippet-jquery-auto-target-blank-link/

Initial Description
Add class external to all target=_blank links

Initial Title
jQuery target blank link

Initial Tags
css, javascript, jquery

Initial Language
JavaScript