Part of your problem is 'myTable' is the id for all three tables. You should set a 'RecCount=0' just before the 'Do While' and add a counter (i.e. - RecCount = RecCount + 1) right before the 'Loop' and set the table id's to 'id="myTable_<%= RecCount %>"'.
Now, you have distinct id's and can run your javascript function. You just need to modify the function to accept the number of the id you are wanting to change...
Code:
<script type="text/javascript">
function check(x, WhichTable)
{
document.getElementById(WhichTable).backgroundColor=x
}
</script>
... to call it...
Code:
onclick="check(this.value, 'myTable_<%= RecCount %>')"
To use the simpler 'onclick' code from dsagrera, you would need to still have distinct table id's and the 'onclick' should be...
Code:
onclick="myTable_<%= RecCount %>.style.backgroundColor='blue';"
...or...
Code:
onclick="myTable_<%= RecCount %>.style.backgroundColor=this.value;"
Bookmarks