First of all, you can add a listener directly to the span as follows:
$('span').click(function(e) {
Then you can add the class attribute to the DIV
$('#box').append($(e.target).attr('class'));
Ok let's try this then
$('.link_to_rule_them_all').click(function(e) {
If you want to add the span class as TEXT:
$('.link_to_rule_them_all').click(function(e) { var box = $('#box'); box.text(); box.append($(this).children('span').attr('class')); )}
source share