$('tr:has(img)').addClass('odd');
On Nov 22, 1:53 pm, Toccamonium <[EMAIL PROTECTED]> wrote: > Hi, > > I'm using this code to add alternating table rows: > $('.content_table tr:odd').addClass('odd'); > $('.content_table tr:even').addClass('even'); > > Now I have some cells with images includes: > <tr> > <td> </td> > </tr> > Here I want to have another class added. > > Now I tried to get all the <tr> where an image is contained. > Unfortunately I couldn't figure out how to select them. > For instance: > $('tr>td>img').addClass('odd'); > Here the img got the class "odd" but I need the oposite way. > <tr> should get it. > > Any ideas how to write this? > > thanks > T.C. > -- > View this message in > context:http://www.nabble.com/Selectors-tr-and-img-tf4856457s27240.html#a1389... > Sent from the jQuery General Discussion mailing list archive at Nabble.com.