How can I get the class name of the current element that is on mouseover? For example
<
Do you want the class name of the div on which the mouseover event occurs? If that is the case then refer this,
HTML
aaaaaaaa
bbbbbbbbb
jQuery
$(document).on('mouseover', 'div', function(e) {
console.log($(e.target).attr('class'));
});
jsFiddle
I have used mouseover event with target
e.target gives the element on which that event occurs
If you want to get the class name of div after leaving the mouse from it then use "mouseleave" event instaed of "mouseover"