Link to home
Start Free TrialLog in
Avatar of whiwex
whiwex

asked on

How to you change a gridview rows background color for chrome

I am using vb.net.
I have a gridview with a checkbox in column 0. When the checkbox is selected it fires a script that changes the background color of the row. It works fine in internet explore but not in chrome. I set the checkboxes onclick in the gridview's rowdatabound event. Here is my script code
<script type="text/javascript">
    //variable that will store the current color of the selected row
    var RowColor;
    function ChangeRowColor(row) {
        //get the color of the selecte row
        RowColor = document.getElementById(row).currentStyle.backgroundColor;
        // if current color is white then change it to blue
       if (RowColor == "#ffffff") {
            // change the color to blue
           document.getElementById(row).style.backgroundColor = "#3399FF";
        }
        // if current color is white then change it to blue  
        else if (RowColor == "white") {
        document.getElementById(row).style.backgroundColor = "#3399FF";
        }
        else
        //  current color is blue then change it to white
        {
            document.getElementById(row).style.backgroundColor = "#ffffff";


        }
    }
     </script>

How do I get this to work in chrome?
ASKER CERTIFIED SOLUTION
Avatar of Robert Schutt
Robert Schutt
Flag of Netherlands image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial