I have a series of image thumbnails in a page. They are created using css sprites.
You could use a Regex, but using split and indexof will be understood by more programmers. Also for something so simple, maybe better to avoid Regex.
In the event handler use the jQuery normalized Event object:
$("[class^=galleryImg]").click(function(Event) {
var classAttribute=Event.target.className
var classes=classAttribute.split(" ");
for (var i=0;i