0

I am using the tabs of jQuery UI

How do I switch to another tab from current tab in the application pro-grammatically using javascript and jquery on an event eg click of button.

2 Answers2

0

Due to security concerns it is not possible. If by "tab" you mean a window and a popup window that opened up in a new tab.

window.opener.focus();

If you want to change to another tab in a Jquery UI tab by programmatically trigger the click event.

$('#id_of_tab').click();
Manu Varghese
  • 791
  • 8
  • 25
0

The jQuery UI Tabs use normal links to change the tabs. So easiest way to change tab is just clicking the link (with javascript/jquery). Say the link in your tab has an id like this:

<div id="tabs">
  <ul>
    <li><a href="#tabs-1" id="tab-1">Nunc tincidunt</a></li>
    <li><a href="#tabs-2" id="tab-2">Proin dolor</a></li>
    <li><a href="#tabs-3" id="tab-3">Aenean lacinia</a></li>
 </ul>

If you want to change to tab 2 you can use $('#tab-2').click();

Fels
  • 1,214
  • 2
  • 13
  • 27