Open Link in a New Tab with jQuery

jQuery(document).ready(function(){ jQuery('a.new-tab').attr('target', '_blank'); });
Use jQuery to add target="_blank" to links. Useful for dynamically generated links.

Be the first to comment

You can use [html][/html], [css][/css], [php][/php] and more to embed the code. Urls are automatically hyperlinked. Line breaks and paragraphs are automatically generated.