<nav>
<label class="my-label" for="my-field">hello</label>
</nav>
<form class="my-form" action="" method="GET">
<input class="my-input" type="text" name="search-field">
</form>
I need a css selector that selects the label.my-label when the input.my-input is focused.
Something like .my-label if .my-input:focused { color: red; }
.
This should change the text color of the label to red if the input is focused.
Is there something that can do this in the current browsers?