I have the following HTML structure:
<form action="" id="form-contato">
<label for="nome">Nome</label>
<input type="text" name="nome" id="nome" placeholder="Nome"/>
<label for="email">E-mail</label>
<input type="email" name="email" id="email" placeholder="[email protected]">
<label for="assunto">Assunto</label>
<input type="text" name="assunto" id="assunto" placeholder="Assunto">
<label for="mensagem">Mensagem</label>
<textarea name="mensagem" id="mensagem" placeholder="Escreva aqui sua mensagem"></textarea>
<button class="bt">Enviar</button>
</form>
Iwouldliketoselectthelastlabelcorrespondingtotheinputthatreceivedfocustostylizeitandemphasizewhichfieldisfocused.
Forexample,givingfocustotheinputwithid="name" would like to select the label with attribute for="name".
I tried to use the ~ selector, but this would work only if the label came after the input, which would leave the HTML somewhat semantic.
Thank you in advance! (y)