Changing background onchange on check box: jquery
<p>I am new to jquery and i am having problem i want to change background color of parent div when i click at checkbox</p>

<p>Please Advice</p>

<p>Thank You        </p>

<pre><code>&lt;script type="text/javascript"&gt;
    function chngbg(id){
        id2 = "d-" + id;
        $(id2).addClass('bg');
    }
&lt;/script&gt;

&lt;div class="dataDiv" id="d-&lt;?=$row-&gt;id?&gt;"&gt;
    &lt;input type="checkbox" onchange="chngbg($(this).val());" value="&lt;?=$row-&gt;id?&gt;" name="cbox" /&gt;&lt;/span&gt;
&lt;/div&gt;
</code></pre>
