Method 1

function open_in_new_tab(url )
{
  window.open(url, '_blank');
  window.focus();
}

Method 2

 $('a').click(function() {
  $(this).attr('target', '_blank');
 });

Method 3

 $(document).ready(function() {
   $('#NewTab').click(function() {
        $(this).target = "_blank";
        window.open($(this).prop('href'));
        return false;
   });
});​

Leave a reply