Programmatically change Jquery tab focus

jquery, jquery-tabs, jquery-ui

Solution

UPDATE Since jQuery UI 1.9

The select method has been deprecated in favor of just updating the active option.

You should replace all calls to the select method with calls to the option method to change the active option.

// Activate the third panel
$( "#tabs" ).tabs( "option", "active", 2 );

Problem

I'm using a pretty simple implementation of the JQuery Tabs UI element. There is a form in the first tab that I am trying to have load the second tab with the onsubmit event. In ActionScript, I could use: ``` tabBar.selectedIndex = n; ``` Where `selectedIndex` is the tab number that has focus. Is there a way to get this done in Jquery?

Original source