Hello folks,

I have a table of data, with each row containing a checkbox. What I want users to be able to do is tick the box of each row of data they want to delete (and after ticking, they will submit the form etc etc.

As a visual aid, I want to alter the background colour of the row - and if they untick a selection, to reverse that background colour change.

My code as follows achieves the background colour toggle, but the checkboxes are neither checked or unchecked.

I'd appreciate someone pointing out my error?


$('[EMAIL PROTECTED]').toggle(
    function() {
      $(this).attr('checked',true);
      
$(this).parents('tr').animate({backgroundColor:'#9C3'},2000).animate({backgroundColor:'#FFF'},1000);
    },
    function() {
      $(this).attr('checked',false);
      
$(this).parents('tr').animate({backgroundColor:'#9C3'},2000).animate({backgroundColor:'#E0F88F'},1000);
    }
);

Thanks
Bruce 

Reply via email to