JSFiddle - React, Tailwind, and code Playground
HTML
<table class="table">
<tr>
<td>123</td>
<td>456</td>
<td>123</td>
<td>456</td>
</tr>
</table>
<ul>
<li>123</li>
<li>457</li>
</ul>
JavaScript
$("td").on("mouseover", function () {
var tdVal = $(this);
$("li").each(function() {
if ($(this).text() == tdVal.text()) {
tdVal.css("background", "yellow");
}
});
}).on("mouseleave", function() {
$(this).css("background", "white");
});