Is there a way to retrieve the text from an element while simultaneously triggering a 'hover' action on another element?
Here is an illustration:
I am trying to gather all available colors, but the color names are only visible upon hovering over the color box.
This is my attempted solution:
$("#color1 div[data-color='KS8866']").trigger("mouseenter",function() {
var color = $("span.color-name").text();
});
Appreciate any help!