I am trying to get class of an element, but it shows its parent class if current element class is empty. 

I just want to check if current element has class if not do nothing but dont show parent class

```
$('*').click(function(){
    var class_of_el = $(this).attr('class').replace('test', '').replace('test2', '');
    alert(class_of_el);
});

```

here is the fiddle :<http://jsfiddle.net/howtoplease/cpENU/>