Try this code to do this task,
$('.cls').mouseover(function () {
alert($(this).attr('class').replace('cls', ''));
});
Above code would take the entire class attribute of the element, will trim the
cls
section from the value returned and alert would show a dialog box having the
second class name.
Test this in the
fiddle[
^] I've created.