function test(){ var count = $('#tt').tabs('tabs').length; for(var i=count-1; i>=0; i--){ $('#tt').tabs('close',i); }}