JSFiddle - React, Tailwind, and code Playground
HTML
<span id="f000020">It is impossible to say how first the idea entered my brain;</span>
<span id="f000020t" onmouseover="highlighton('f000020', 'f000020t')" onmouseout="highlightoff('f000020', 'f000020t')">Es imposible decir cómo es que por vez primera la idea entró a mi cerebro;</span>
CSS
.highlight
{
background-color: yellow;
}
JavaScript
function highlighton(id1, id2) {
document.getElementById(id1).className += "highlight";
document.getElementById(id2).className += "highlight";
}
function highlightoff(id1, id2) {
document.getElementById(id1).className -= "highlight";
document.getElementById(id2).className -= "highlight";
}