Problem while changing the background color of a table using javascript
<p>I am trying to change the <strong>background color</strong> of a <strong>table</strong> on <strong><code>onchange</code></strong> event of a <strong>checkbox</strong>. My checkbox is inside my table. I have written a simple javascript code but I am unable to change the color of my table if any one can help me regarding this problem. Here is my code..</p>

<pre>
    function getcolor()
    {

       var color=document.getElementById("item");
        var color2=document.getElementById("item").bgColor = 'red';
        alert(color.bgColor);
        alert("its"+color2.bgColor);
    }
</pre>

<p>while my table has id='item'. Here is my checkbox code</p>

<pre><code>&lt;input type="checkbox" id='id' onchange="getcolor();"/&gt;
</code></pre>

<p>Thanks.......</p>
