views:

33

answers:

2

I have my click function set up to look for the first link in the div and assign that link to the entire div.

$('.article-excerpt').click(function() {
 var newLink = $(this).find('a:first-child').attr("href");
 if(newLink != "" && newLink != "#") {
  window.location.href = newLink;
 }
 return false;

});

How can I also make that link in a new window?

+1  A: 
window.open(newLink)
Malvolio
+3  A: 
$('.article-excerpt').click(function() { 
  var newLink = $('a:first-child',this).attr("href"); 
  if(newLink != "" && newLink != "#") { 
    window.open(newLink);
  }
  return false;
});
volkan er