Hey there, I'm trying to get the classname of an element I'm hovering and assign a background-color to this specific class. I get the classname with Michel's solution from https://stackoverflow.com/a/21912356 :
$(document).on('mouseover', 'div', function(e) {
console.log($(e.target).attr('class'));
});
But how do I achieve that all the elements of the class I'm hovering get the same color (or - as an improvement - a random color)?