<HTML>
<HEAD>
<TITLE> New Document </TITLE>
<script type="text/javascript" src="js/jquery-1.8.3.min.js"></script>
<style>
ul{margin:0; padding:0;}
ul li{list-style-type:none;margin:0; padding:2px; width:140px;}
</style>
<ul class="adf">
<li>
<label><input type="checkbox" value="aaaa" /><span style="margin-left:80px;">aaaa</span></label>
</li>
<li>
<label><input type="checkbox" value="bbbb" /><span style="margin-left:80px;">bbbb</span></label>
</li>
<li>
<label><input type="checkbox" value="cccc" /><span style="margin-left:80px;">cccc</span></label>
</li>
</ul>
<script language="javascript">
$(function () {
$("ul li").click(function () {
var cbx = $(this).find("input[type='checkbox']");
if (cbx.attr("checked")) {
$(this).css({ "background-color": "Green" });
} else {
$(this).css({ "background-color": "White" });
}
});
});
</script>
<HEAD>
<TITLE> New Document </TITLE>
<script type="text/javascript" src="js/jquery-1.8.3.min.js"></script>
<style>
ul{margin:0; padding:0;}
ul li{list-style-type:none;margin:0; padding:2px; width:140px;}
</style>
<ul class="adf">
<li>
<label><input type="checkbox" value="aaaa" /><span style="margin-left:80px;">aaaa</span></label>
</li>
<li>
<label><input type="checkbox" value="bbbb" /><span style="margin-left:80px;">bbbb</span></label>
</li>
<li>
<label><input type="checkbox" value="cccc" /><span style="margin-left:80px;">cccc</span></label>
</li>
</ul>
<script language="javascript">
$(function () {
$("ul li").click(function () {
var cbx = $(this).find("input[type='checkbox']");
if (cbx.attr("checked")) {
$(this).css({ "background-color": "Green" });
} else {
$(this).css({ "background-color": "White" });
}
});
});
</script>