Replaced elem.attr('data-*') with elem.data('*)