I've created a script to change the background color of a checkbox when it's checked, but unfortunately, it doesn't work on Mozilla.
<script type="text/javascript">
function checkBoxList1OnCheck(listControlRef)
{
var inputItemArray = listControlRef.getElementsByTagName('input');
for (var i=0; i<inputItemArray.length; i++)
{
var inputItem = inputItemArray[i];
if ( inputItem.checked )
{
inputItem.parentElement.style.backgroundColor = 'Red';
}
else
{
inputItem.parentElement.style.backgroundColor = 'White';
}
}
}
</script>
<form id="form1" runat="server">
<div>
<asp:CheckBoxList id="CheckBoxList1" onclick="checkBoxList1OnCheck(this);" runat="server">
<asp:listitem value="1">Item 1</asp:listitem>
<asp:listitem value="2">Item 2</asp:listitem>
<asp:listitem value="3">Item 3</asp:listitem>
</asp:CheckBoxList>
</div>
</form>
and even in page load i add as follows
CheckBoxList1.Attributes.Add("onclick", "checkBoxList1OnCheck(this);");
But still i am unable to work it out in Mozila can any one help me