Change the text of a tab

Change the text of a tab


Is it possible to dynamically update the text displayed on a tab?
The only way I could see was something like this:
$('#myTabs').data('tabs.tabs').$tabs[4].firstChild.innerHTML = 'New
Tab Text';
Is there a cleaner approach?
BTW, I tried deleting and re-adding the tab, but the new tab doesn't
get the 'ui-tabs-nav-item' class applied, so it doesn't look at all
tab-like, at least using a modified theme builder theme. Is there
something special that needs to be done for this to work correctly? Or
am I misunderstanding how to use tabs.add() ?
Thanks,
s