<div>highlight me</div><div><input /></div>
When the user puts their cursor in the input box and triggers :focus, I want to highlight the first div (apply a style to it).
non working example: https://codepen.io/samkeddy/pen/vJaqqv
<div>highlight me</div><div><input /></div>
When the user puts their cursor in the input box and triggers :focus, I want to highlight the first div (apply a style to it).
non working example: https://codepen.io/samkeddy/pen/vJaqqv
 
    
    Actually previous solution is absolute but 
 If you dont want to use the javascript here you can go with little css  i have done i dont if this helps you or not but a small approach towards your question
 
input:focus + .head{
  color: red;
}<input>
<div class="head">highlight me</div> 
    
    function highlight()
{
var div=document.getElementById("higlightDiv");
  div.style.color="red";
}div{
  color:blue;
}<div id="higlightDiv">highlight me</div><div><input type="text" onfocus="highlight();" /></div>You can do it like this with javascript I guess
