I am trying to write a script that will find all <a> tags whose target is either a jpg, gif, or png and attach a function to them.
$('a')
.filter(function(){
return this.href.match(/*probably some regex here?*/)
})
.bind('mouseover', function(){
alert('foo');
})
This should work, but I don’t know what the regex would look like. If there’s a better way, please let me know that as well. Thanks!
You almost had it!!!