Return to Snippet

Revision: 30919
at August 25, 2010 11:34 by Moridin

Initial Code
$(function() {	
	$('a[rel^=external]').each(function() {
		$(this).attr('target', '_blank');

Initial URL

Initial Description
Uses jQuery to give links with rel=\"external\" the ability to open in a new window, while keeping the document XHTML or HTML Strict. Works by assigning a \"_blank\" value to the \"target\" attribute of all such links after the page has already loaded.

Initial Title
Valid (X)HTML Strict with external links

Initial Tags
html, xhtml, links

Initial Language