Bug Tracker

Opened 12 years ago

Closed 12 years ago

#8264 closed bug (invalid)

parent child selector does not work for table

Reported by: [email protected] Owned by:
Priority: low Milestone: 1.next
Component: selector Version: 1.5
Keywords: Cc:
Blocked by: Blocking:



I am evaluating jQuery for my company. I found issue where parent child selector does not work for table. I placed table with class bold and have 6 rows with some data and I want to change background color of odd rows. Syntax I used is as below.

 $('table.bold > tr:odd').css("background-color", "#bbbbff");

I tested this in chrome and IE 9.

Change History (1)

comment:1 Changed 12 years ago by jitter

Component: unfiledselector
Priority: undecidedlow
Resolution: invalid
Status: newclosed

Thanks for taking the time to contribute to the jQuery project by writing a bug report.

This isn't a bug in jQuery. Your selector must take into account that browsers may automatically insert a tbody element into your table. Check http://jsfiddle.net/jitter/bYhnU/2/

working example

Note: See TracTickets for help on using tickets.