function getSelectedTabId() { var tabIndex = $tabs.tabs('option', 'selected'); var $selected = $("#tabs ul>li a").eq(tabIndex).attr('href'); return $selected; }