JSFiddle - React, Tailwind, and code Playground

HTML

<div id="a">Div A</div>
<div id="b">Div B</div>
<br><br>
<div id="c">Div C</div>
<div>~~~~</div>
<div id="d">Div D</div>

CSS

#a:hover + #b {
    background: #f00
}

#c:hover ~ #d {
    background: #f00
}

JavaScript

document.getElementById('b').onmouseover = function(){
    document.getElementById('a').style.backgroundColor = '#f00';
}

document.getElementById('b').onmouseout = function(){
    document.getElementById('a').style.backgroundColor = '';
}

$('#d').hover(
  function(){
  	   $('#c').css('background', '#F00')
   }, 
   function() { 
       $('#c').css('background', '')
});