开发者

JavaScript: how to switch between tabs?

开发者 https://www.devze.com 2023-01-17 04:13 出处:网络
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

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

精彩评论

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