How can we programmatically select a tab in the jQuery Mobile navigation bar? I tried to make the code below. But to no avail.
var tabButton = document.getElementById("tabId2"); tabButton.className = "ui-btn-active";
UPDATE:
Please check this: http://jsfiddle.net/YnxML/15/
UPDATE:
Below is the code that I used to create the navigation bar in the footer.
<div data-role="page" data-theme="b" id="option-page"> <div data-role="footer" data-id="foo1" data-position="fixed"> <div data-role="navbar"> <ul> <li><a href="#" id ="tabId1"onclick="method1();" >1</a></li> <li><a href="#" id ="tabId2" onclick="method2();" >2</a></li> <li><a href="#" id ="tabId3" onclick="method3();">3</a></li> </ul> </div> </div>
source share