Select a jQuery UI tab by link


It will often be the case that you will need to trigger a jQuery UI tab from a bespoke link.

This can be done using following the formats listed below: 


//Latest jQuery UI

$(selector).tabs('option', 'active' ,0);

//Older jQuery UI 


// Example

<button type="button" class="btn btn-default" data-tab="0">Tab 1</button>


        var tabId = $(this).data('tab');


        jQueryTabs.tabs('option', 'active', tabId);

        //jQueryTabs.tabs('"select', tabId);  //older version of jQuiry UI

        return false;