Following is my code:
<table border="0" align="center" cellpadding="0" cellspacing="0" class="grid_table">
<tr class="grid_caption"><td class="grid_caption">Customer Name</td></tr>
<? if(count($arrResult) > 0) { ?>
<? foreach($arrResult as $row) { ?>
<tr class="grid_row" ><td class="grid_row" onClick="javascript:return selectCustomer(this,<?=$row['customer_id']?>);"><?=HTMLVarConv($row['Name'])?></td></tr>
<? } ?>
<? } ?>
</table>
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
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+"&showmenu=0");
$("#ajaxList").show();
return;
}
but not changing what the problem ????
please help me
This one is perfect well:
Css::
Following is my Javascript code:-
THis is my code: