1
I have an image inside a div.facebook who receives the clike
mouse and redirects to an external page:
$("div.facebook img").click(function() {
$(location).attr('href','http://www.facebook.com');
});
Turns out I’d like it to open in another window.
I tried several options, among them:
$("div.facebook img").click(function() {
$(location).attr('href','http://www.facebook.com');
.attr('target','_blank')
});
But it didn’t work.
What can be done in this case to continue with jQuery?
Failed. Redirect occurs. But NOT with target Blank
– Carlos Rocha
I edited the answer.
– LeAndrade
does <img rel="External" src='' /> work? Because if it works, just set default to normal href
– Carlos Rocha