Suppose we have HTML:
<div id="wrapper">
I want this to change color when button hovered
<div class="button">Close</div>
</div>
We can change the element’s style when the wrapper is hovered:
#wrapper:hover .button{
color:red
}
Now want the opposite thing:
button:hover #wrapper{
background:yellow
}
@dan; you can do this with css also like this:
check this example http://jsfiddle.net/sandeep/b6apC/ .It’s a fake but can achieve that effect with css.