JavaScript: how to switch between tabs?
So I created some tab using XUL. How can I write开发者_开发知识库 JavaScript code so that if I click on a button in tab 1, tab 2 will be shown?
Get the tabs element and set the selected Index property to the index of the tab you want. e.g. if the tabs element is 'mytabs' and you want to select the 2nd tab...
document.getElementById("mytabs").selectedIndex = 1;
精彩评论