is there anyway to get the class when click event is fired. My code as below, it only work for id but not class.
If you are using jQuery 1.7:
alert($(this).prop("class"));
or:
alert($(event.target).prop("class"));