开发者

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;
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜