Answered: Selecting even table rows from a table element
Posted
by mvrak
on Stack Overflow
See other posts from Stack Overflow
or by mvrak
Published on 2010-05-01T16:27:51Z
Indexed on
2010/05/01
16:37 UTC
Read the original article
Hit count: 180
jQuery
|jquery-selectors
The issue I am having is:
How do I go from a variable pointing at an element to using CSS selectors?
I want to make this work:
function highlight(table)
{$(table " > :even").toggleClass('highlight');}
where table is a reference to a table element.
I don't want answers that tell me to use $('#table') because that defeats the point of the generality I am trying to make.
Thanks
© Stack Overflow or respective owner