Oh...okay.
Code:
var images = document.getElementsByTagName("img");
var found = false; // or null
var lookFor = /xxxx.jpg$/i;
for ( var i = 0; i < images.length; ++i )
{
if ( lookFor.test( images[i].src )
{
found = true; // or found = images[i] if you want a reference to it
break;
}
}
if ( found ) ...
or
if ( found != null ) ...