Updating classnames according to checkbox status
<p>I have a table with multiple rows, each having it's own checkbox. I have the following script to invert all checkboxes:</p>

<pre><code>$("INPUT[type='checkbox']").each(function(){
    if (this.checked == false) {
        this.checked = true;
    } else {
        this.checked = false;
    }
});
</code></pre>

<p>Now, I want that each row (it has it's unique ID - like <code>id='row1'</code> <code>id='row2'</code> etc etc) to have their classnames changed: if the checkbox is going to be checked it should change to <code>class1</code> else to <code>class2</code>.</p>

<p>How would this be done? I'm new to jQuery so I have no idea how I would get the element ID or something. I don't know how to match the checkbox with the row.</p>

<p>Thanks in advance.</p>
