chepukha
chepukha

Reputation: 2489

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?

Upvotes: 0

Views: 3125

Answers (1)

pc1oad1etter
pc1oad1etter

Reputation: 8617

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;

Upvotes: 2

Related Questions