Q:

jQuery track down name of div by mouse pointer

Is it possible to store DIV name into variable when I hover over it?
Example:
<div class="bar1">Text 1</div>
 <div class="bar2">Text 2</div>
And when I hover over "Text 1", name of a DIV will be stored in jQuery variable. And when I hover to "Text 2" DIV name will be stored to variable.
var class_name = $(""); DIV name stored in there 

A:

Sure...
$('.bar1,.bar2').mouseover(function(event){
    var class_name = $(event.currentTarget).attr('class');
});​

...see it running here.

