is there anyway to get the class when click event is fired. My code as below, it only work for id but not class.
Try:
$(document).ready(function() { $("a").click(function(event) { alert(event.target.id+" and "+$(event.target).attr('class')); }); });