Check if asp Checkbox is checked in a row of a GridView with Javascript
<p>I have a grid view and I want to see if the checkbox in the first column is checked. If the check box is checked it opens a new window. I cannot figure out how to see if the checkbox is checked. Please help the function below is not working and I can't figure out why.</p>

<pre><code>function mapSelectedClick() 
    {
        var CustomerIDs = "";
        var grid = document.getElementById('&lt;%=grdCustomers.ClientID %&gt;');

        for (var i = 1; i &lt; grid.rows.length; i++)
        {
            var Row = grid.rows[i];
            var CustomerID = grid.rows[i].cells[1].innerText;
            if (grid.rows[i].cell[0].type == "checkbox")
            {
                if (grid.rows[i].cell[0].childNodes[0].checked)
                {
                    customerIDs += CustomerID.toString() + ',';
                }
            }
        }

        customerIDs = customerIDs.substring(0, customerIDs.length-1);
        window.open("MapCustomers.aspx?CustomerIDs=" + customerIDs);
    }
</code></pre>
