<html>
<script type="text/javascript" src="jquery-1.2.6.js"></script>
<script type="text/javascript">
$(document).ready(function () {
$("#div a").filter("[href$=.jpg], [href$=.jpeg], [href$=.png], [href$=.gif]").css("color", "red");
});
</script>
<body>
<div id="div">
<a href="path/image.jpg">text</a>
<a href="path/image.jpeg">text</a>
<a href="path/image.png">text</a>
<a href="path/image.gif">text</a>
<a href="path/image.bmp">text</a>
</div>
</body>
</html>