I want to fade in / fade out the row background color css when a user checks a checkbox. So when they check it, the row fades in to bright yellow. When they un-check it, the row fades out to white.
This is the JS I am playing with. I am using the color plugin:
<script type="text/javascript">
<!--
$(document).ready(function(){
$("#Table input").click(function() {
if ($(this).attr("checked") == true) {
$(this).parent().parent().animate({'backgroundColor' : '#ffff99'});
} else {
$(this).parent().parent().animate({'backgroundColor' : '#ffffff'});
}
});
});
//-->
</script>
and HTML
<form name="f">
<table id="Table" border="1"><tr>
<td width="117"><input type="checkbox" name="cb1" id="cb1" value="y" /></td>
<td width="309">Click me</td>
</tr><tr>
<td><input type="checkbox" name="cb2" id="cb2" value="y" /></td>
<td>Click me</td>
</tr><tr>
<td><input type="checkbox" name="cb3" id="cb3" value="y" /></td>
<td>Click me</td>
</tr></table>
</form>
I am a complete newbie so thanks for the help