I want to try and create tabs from a current html page without changing the html of the page.
The content is structured with a H3 and then a table this repeats x amount of times.
I want to grab the h3 name the tab using the h3 text then get the table following it and make that the tabs content.
simples?

?
Here is my code:
(function($){
$.fn.tabify = function(){
$('#your-profile').prepend('<div class="wpt-ui-tabs-wrapper"/>');
$('.wpt-ui-tabs-wrapper').prepend('<ul class="wpt-ui-tabs-nav"/>');
return this.each(function(i){
var tabList = $('.wpt-ui-tabs-nav');
var panelContents = $(this).next().detach();
var tabName = $(this).detach();
$(tabList).append('<li><a href="#ui-tab-panel' + i +'">' + tabName.text() + '</a></li>');
var thisPanel = $('<div id="ui-tab-panel' + i +'" class="wpt-ui-tabs-panel"/>');
$(thisPanel).prepend(panelContents.html());
$('.wpt-ui-tabs-wrapper').prepend(thisPanel);
$('.wpt-ui-tabs-wrapper').prepend(tabList);
$('.wpt-ui-tabs-wrapper').tabs();
});
};
})(jQuery);
$(document).ready(function(){
$('h3').tabify();
});
can anyone spot where i am going wrong?