I have a java script code that highlights each row after it is selected by a checkbox
( i am using a control called gridview in asp.net )
i want the code to perform two things
1- highlight the row when it is selected ( when the checkbox status is checked ) .
2- cancel the highlighting when the checkbox is deselected again ( when the checkbox status is unchecked ) .
the code already makes the first thing successfully
my problem is in the second case ( i mean when the checkbox is unchecked ) the color (highlighting ) doesn't change .
here is the function
=======================================
function Check_Click(objRef)
{
//Get the Row based on checkbox
var row = objRef.parentNode.parentNode;
//Get the reference of GridView
var GridView = row.parentNode;
//Get all input elements in Gridview
var inputList = GridView.getElementsByTagName("input");
for (var i=0;i<inputList.length;i++)
{
//The First element is the Header Checkbox
var headerCheckBox = inputList[0];
//Based on all or none checkboxes
//are checked check/uncheck Header Checkbox
var checked = true;
if(inputList[i].type == "checkbox" && inputList[i] != headerCheckBox)
{
if(!inputList[i].checked)
{
row.style.backgroundColor = "#C2D69B";
checked = false;
break;
}
}
}
headerCheckBox.checked = checked;
}
====================================
please help me .. i need this code
thanks in advance


