Alex Rivera | Logout

jQuery Checkboxes

Asked 2009-07-21T16:19:57.297
11

I'm trying to write a piece of jQuery code where, if all checkboxes are "unchecked", then all li tags have the class "disabled."

But, if one checkbox (any checkbox) is checked, then all [li] tags lose the class "disabled".

Many thanks!

Edit
Report

1 Answer

8

I came across this post by accident and I thought I would add my shilling worth:

jQuery(':checkbox').click(function()
{
    if (jQuery(this).is(':checked'))
    {
        alert("Checked");
    }
    else
    {
        alert("Unchecked");
    }
});
answered 2011-01-28T09:56:45.550

Your Answer