changed attr('data-target') to data('target');

this will extend js interface, to be possible to setup targets for tabs that setted like 

    var content=$('<div class="tab-pane">',{text: 'content'});
    var tab=('<li>',{html: $('<a>',{text: 'Main options'})}).addClass('active').data({target: $main,toggle: 'tab'}).appendTo(tabs);

or just selected to js variable.