I want to change background color after clicking using javascript
<p>Following is my code:</p>

<pre><code>&lt;table border="0" align="center" cellpadding="0" cellspacing="0" class="grid_table"&gt;
    &lt;tr class="grid_caption"&gt;&lt;td class="grid_caption"&gt;Customer Name&lt;/td&gt;&lt;/tr&gt;
    &lt;? if(count($arrResult) &gt; 0) { ?&gt;
        &lt;? foreach($arrResult as $row) { ?&gt;
        &lt;tr class="grid_row"  &gt;&lt;td class="grid_row" onClick="javascript:return selectCustomer(this,&lt;?=$row['customer_id']?&gt;);"&gt;&lt;?=HTMLVarConv($row['Name'])?&gt;&lt;/td&gt;&lt;/tr&gt;
        &lt;? } ?&gt;
    &lt;? } ?&gt;
&lt;/table&gt;
</code></pre>

<p>here i got the list of customer
but when i click on this customer name then its background color should be change..
here is my javascript function </p>

<pre><code>function selectCustomer(row, id) {
    alert(row);
    var mark_color = '#fdf5d2' //'#c1c1ff'
    var current_row = '#aad4f0' //'#e8e8e8'
    if (row.style.backgroundColor == current_row) {
        row.style.backgroundColor = mark_color;
    }
    else if (row.style.backgroundColor == mark_color) {
        row.style.backgroundColor = current_row;
    }
    $("#editCustomer").attr("src","editcustomer.php?customer_id="+id+"&amp;showmenu=0");
    $("#ajaxList").show();
    return;
}
</code></pre>

<p>but not changing what the problem ????
please help me</p>
