millionmonkey wrote:
This works - but I was wondering if there is a cleaner more jquery way to do the same thing? Perhpas there is a selector that I missed in the docs?s = $("img").eq(0).attr("src") if (s.search("images/m")>0) { $("img").eq(0).addClass("newimage") }
I'm not sure, but I think this would do it: $("img[src*=images/m]").eq(0).addClass("newimage"); -- Scott