xylude 3 Junior Poster

I spent some time this morning trying to figure this out, and finally did. I thought I would share:

$('body').click(function(event){	
     //You can swap .attr('class') with whatever and it probably will work. Nested divs may return the top parent's class, so you may need to fool around with it some. If element has no class it will return null.
     var clickTarget = $(event.target).attr('class');
});
Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.