JSFiddle - React, Tailwind, and code Playground

HTML

<a id="AB" href="" class="divone marker"><span>This is ab</span></a>
<a id="ABA" href="" class="divtwo marker"><span>This is aba</span></a>
<a id="ABAB" href="" class="divthree marker"><span>This is abab</span></a>

<div id="divone">divone</div>
<div id="divtwo">divtwo</div>
<div id="divthree">divthree</div>

CSS

a {
    background: #a9d;
    margin: 5px;
}
div {
    background: #69d;
    margin: 5px;    
}
.active {
    background: #d99;
}

JavaScript

jQuery(function($) {
    $('div').hover(function(e) {
        $('.' + this.id)[e.type == 'mouseenter' ? 'addClass' : 'removeClass']('active');
    })
});