Is there a way to combine these two similar functions into one in order to compress the JavaScript code? They both serve the same purpose but target different CSS classes. The goal is to highlight different images when hovering over specific list items - each list item corresponds to a different image.
$(".class1").mouseenter(function () {
$(".class2").addClass("highlight");
});
$(".class3").mouseenter(function () {
$(".class4").addClass("highlight");
});