I found it interesting how others were struggling with this task, but I managed to solve it easily. It did make me question if I had misunderstood your requirements, but I am confident that I interpreted them correctly.
To achieve the desired functionality, I utilized mouseenter and mouseleave events along with a combination of ids and div elements.
For the implementation, I leveraged jQuery, so ensure that you have included the jQuery library in your project.
$(document).ready(function(){
/* Start of Verbs */
$("#verb").mouseenter(function(){
$(".verb").css("text-shadow", "1px 1px 1px blue");
});
$("#verb").mouseleave(function(){
$(".verb").css("text-shadow", "");
});
/* End of Verbs */
/* Start of Nouns */
$("#noun").mouseenter(function(){
$(".noun").css("text-shadow", "1px 1px 1px red");
});
$("#noun").mouseleave(function(){
$(".noun").css("text-shadow", "");
});
/* End of Nouns */
});
#verb {
}
.verb {
text-shadow: none;
display: inline;
}
#noun {
}
.noun {
text-shadow: none;
display: inline;
}
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
<p><span id ="noun">Nouns</span> - <span id="verb">Verbs</span></p>
<div class="noun">I</div> like to <div class="verb">ride</div> <div class="noun">my</div> bicycle every day.