What is the opposite of JQuery.not - OR - How to set up targeted href links that contain the following
Right. So let's go.
I am currently using the following code to cover all links and apply the iframe toolbar
$("a[href^='http:']").not("[href*='www.domiain.com']").not("[href*='www.twitter.com']").each(function(){
var tempurl = 'http://www.domain.com/shiftbar/shiftbar.html?iframe=';
var $this = $(this);
var currenturl = this.getAttribute("href");
var href = tempurl + currenturl;
$this.attr('href', href );
});
I need to do the same, but now for links that ONLY contain twitter
$("a[href^='http:']").contains("[href*='www.twitter.com']").each(function(){
$this.attr("target", "_blank");
});
he does not work. I tried
.has
.contains
But I guess I'm not familiar with jquery at the moment.
+2
a source to share