Change CSS for parent div when child element (input field) is selected
<p>I'm looking to change the class of a parent div when a child input text field is selected or the mouse moves over any of the other elements in the container. I've tried using both jQuery and some of the pseudo classes in CSS to no avail.</p>

<p>Javascript:</p>

<pre><code>$("input").focus(function () {
     $(this).parent().parent("div").css('background-color','#666');  
});
</code></pre>

<p>HTML:</p>

<pre><code>    &lt;div class="container_to_change"&gt;
            &lt;div class="box1"&gt;
                &amp;nbsp;
            &lt;/div&gt;
            &lt;div class="box2"&gt;
                &lt;input type="text" class="data-entry"&gt;
            &lt;/div&gt;
            &lt;div class="box3"&gt;
                &amp;nbsp;
            &lt;/div&gt;
    &lt;/div&gt;
</code></pre>
