Is there any way of attaching data to a jQuery event object as it propagates up the DOM?
To clarify, if you have three nested divs, each with a click event listener
Although you cannot attach data directly to the event, you could still attach data to the targetElement via jQuery's data():
$('div').click(function(e) {
var info = $(e.target).data('info') || '';
$(e.target).data('info', info + ' ' + $(this).attr('class'));
});
Here's the fiddle: http://jsfiddle.net/eKVmU/