Sean O schrieb:
> This doesn't do anything (nor does it produce a Firebug error):
>       if ( $(".checklist").is(":checked") ) {
>          ($(this)[0].checked) ? 
> ($(this).parent().css("background","lightgreen"))
> : ($(this).parent().css("background","none"));
>       }
>
> Advice?
>   
is() just checks if there is at least one element that matches the given 
expression. Try this:

$(".checklist:checked").parent().css("background", "lightgreen");

It selects all checked .checklist elements, gets their parents, and sets 
their background.

-- 
Jörn Zaefferer

http://bassistance.de


_______________________________________________
jQuery mailing list
[email protected]
http://jquery.com/discuss/

Reply via email to