To programmatically select a tab in Bootstrap, the jQuery method $('.nav-tabs a[href="#___"]').tab('show') is used.

  • ('.active-tab')
  • ('#selected-tab')
  • ('.nav-tabs li a')
  • ('[data-toggle="tab"]')
The correct syntax is ('.nav-tabs a[href="#selected-tab"]').tab('show'). It targets the tab link with the specified href attribute, activating the tab in Bootstrap.
Add your answer
Loading...

Leave a comment

Your email address will not be published. Required fields are marked *