/ Published in: jQuery
                    
                                        
The following code snippet will highlight the row in a table when the checkbox is checked. It will remove the highlight when the checkbox is unchecked. This will work for basic  as well as a GridView.
The "input:not(#selectAll)" will ignore the row that contains a SelectAll checkbox with the ID "selectAll".
Note: I had a css class defined as highlight where I set the background-color property.
                The "input:not(#selectAll)" will ignore the row that contains a SelectAll checkbox with the ID "selectAll".
Note: I had a css class defined as highlight where I set the background-color property.
                            
                                Expand |
                                Embed | Plain Text
                            
                        
                        Copy this code and paste it in your HTML
$('#SurveyGrid input:not(#selectAll)').click(function () {
if ($(this).attr("checked") == true) {
$(this).parent().parent().addClass('highlight');
} else {
$(this).parent().parent().removeClass('highlight');
}
});
Comments
 Subscribe to comments
                    Subscribe to comments
                
                