Select onclick that contains _blank
i select links with empty target to set title attribute
jQuery('a[target~="_blank"]').attr('title', 'New window');
which is working.
But when I select the onclick attribute that doesn't work
jQuery('a[onclick~="_blank"]').attr('title', 'New window');
any clues?
the link looks like this:
<a onclick="javascript:this.target="_blank"" title="" href="http://link.com">link</a>
+1
source to share
3 answers
This seems to work for me using Attribute contains selector -
$("a[onclick*='_blank']")
Could you use this?
Demo - http://jsfiddle.net/uZaCW/
0
source to share