How to programmatically trigger a click on a tab item

Assuming the following HTML for my tab control

<ul id='tabs' class='mbsc-cloak' style='margin:0px'>
<li data-tab='md-tab-family' data-icon='fa-user' data-id='family'>Family</li> 
<li data-tab='md-tab-activity' data-icon='dribbble' data-id='activity'>Activity</li>
<li data-tab='md-tab-medical' data-icon='aid' data-id='medical'>Medical</li>
<li data-tab='md-tab-milestones' data-icon='fa-trophy' data-id='milestones'>Milestones</li>
<li data-tab='md-tab-send' data-icon='material-send' data-id='send'>Send</li>
</ul>

My javascript function looks like this

function triggerTab(tabid){
   $('[data-tab=' + tabid + ']').trigger('click');
}

So if I have a button on another page and on click of that button I call triggerTab(‘md-tab-medical’), why does this not work?

Hi @Vincent_Wansink,

In this case, you need to use the navigate method. With this method, you can scroll the navigation to the specified item. For example:

inst.navigate('medical');