Search code examples
javascriptasp-classiczurb-foundation

ZURB Foundation, switching tab programmatically


Im using asp with foundation, is there anyway to switch between a tab to another using JS or ASP?

Link (Simple tab).


Solution

  • A possible solution is to assign an id to the tab link and click it using jQuery.

    Given the following code excerpt, notice the id assigned to the anchor link...

    <dd><a href="#simple2" id="tabId">Simple Tab 2</a></dd>
    

    You could activate this link using this line of jQuery.

    $("#tabId").click();