New to jQuery here. I've found several web pages that come close to what I'm trying to do, but not quite. Actually, I think the following is supposed to actually work, but it's saying:
[@href^="http://"]
is not recognized (syntax error). Any help?
$(document).ready(function() {
$('a[@href^="http://"]').filter(function() {
return this.hostname && this.hostname !== location.hostname;
}).attr('target', '_blank');
});
Thanks.