Good Morning! Is it possible to change the parent element by hovering on the child? For example, I have the following:
nav {border:2px solid red}
nav ul li {color:#fff}
nav ul li a:hover {background-color:#ccc}
nav ul li a:hover nav {border:2px solid black}
<nav>
<ul>
<li> <a href="#">Teste</a> </li>
<li> <a href="#">Teste</a> </li>
</ul>
</nav>
When hovering on <a>
, I want <nav>
to change border color.
I've read something about not being able to get the parent element and that this will be available in css 4. If it's really true, how can I do this for js?