I use Jquery UI to create tabs. I want create new tabs with content tab1 = content tab2
1 Answer
You can use a bit of jQuery to accomplish this. Assuming that your jQuery UI tags code looks like:
<div id="tabs">
<ul>
<li><a href="#tabs-1">Tab 1</a></li>
<li><a href="#tabs-2">Tab 2</a></li>
</ul>
<div id="tabs-1"></div>
<div id="tabs-2">Test content</div>
</div>
You can use something similar to the following to copy the content into the first tab.
var content = $('#tabs-2').html();
$('#tabs-1').html(content);
This code takes the HTML string within the tabs-2 div and stores it in a variable. It then sets the content in tabs-1 div to the variable.