I'm currently working on creating an interactive menu using jQuery
for some hands-on practice. At the moment, I have set up my dropdown menu and a side table with a few elements.
https://i.sstatic.net/IZIbL.png
The dropdown menu consists of 4 elements. My objective is this: when hovering over the first
element in the dropdown menu, the first cell in the table changes to red, just like shown in the accompanying image. Similarly, when hovering over the second element from the dropdown list, the second cell (vertically) in the table should turn red while the first one returns to its original color.
Currently, I've managed to change the color of the first cell when hovering over the corresponding element in the dropdown. However, the issue lies in it not reverting back to its original color afterward. Here's the code snippet I used:
$(".first-hover").hover(function(){
$('#first').css({'backgroundColor':'red'})
});
Appreciate any assistance you can provide!