Use data('target') instead of attr('data-target')