Why my javascript is not working in Firefox
<p>I have written the following script to change the back color of check box when checked but this is not working on Mozila</p>

<pre><code>&lt;script type="text/javascript"&gt;
function checkBoxList1OnCheck(listControlRef)
{
 var inputItemArray = listControlRef.getElementsByTagName('input');

 for (var i=0; i&lt;inputItemArray.length; i++)
 {
  var inputItem = inputItemArray[i];

  if ( inputItem.checked )
  {
   inputItem.parentElement.style.backgroundColor = 'Red';
  }
  else
  {
   inputItem.parentElement.style.backgroundColor = 'White';
  }
 }
}
&lt;/script&gt;

&lt;form id="form1" runat="server"&gt;
    &lt;div&gt;
    &lt;asp:CheckBoxList id="CheckBoxList1" onclick="checkBoxList1OnCheck(this);" runat="server"&gt;
  &lt;asp:listitem value="1"&gt;Item 1&lt;/asp:listitem&gt;
  &lt;asp:listitem value="2"&gt;Item 2&lt;/asp:listitem&gt;
  &lt;asp:listitem value="3"&gt;Item 3&lt;/asp:listitem&gt;
 &lt;/asp:CheckBoxList&gt;
    &lt;/div&gt;
    &lt;/form&gt;
</code></pre>

<p>and even in page load i add as follows</p>

<p><code>CheckBoxList1.Attributes.Add("onclick", "checkBoxList1OnCheck(this);");</code></p>

<p>But still i am unable to work it out in Mozila can any one help me</p>
