See the following example:
Let say you have 2 checkboxes in the body of the aspx page:
<asp:CheckBox ID="A5" runat="server" AutoPostBack="false"/>
<asp:CheckBox ID="A6" runat="server" AutoPostBack="false"/>
Add the following css and jquery to the head section:
<style type='text/css'>
.checkedColor {
background-color: red;
}
</style>
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js" type="text/javascript">
</script>
<script type="text/javascript">
$(function(){
var $chk = $('input:checkbox');
// wrap each checkbox with a span tag to act as background
$chk.wrap('<span />');
$chk.click(function(){
$(this).parent().toggleClass('checkedColor');
});
});
</script>
The background color of the span surrounding the checkbox will toggle between red and non-red whenever its checked status changes.
Enjoy.