How to open external links in new window in Javascript

To open external links in new window in Javascript you can use the following snippet.

Sample Javascript

$('a[rel="externalLink"]').click( function() {
	window.open( $(this).attr('href') );
	return false;
});

Please Share us:
Please rate this snippet

2 thoughts on “How to open external links in new window in Javascript

Leave a Reply