JavaScript Programming JavaScript > Code Examples Add or remove a tab Add or remove a tab <html><head> <title>Happy Codings :-) JavaScript - Learn Web Development</title> </head><body bgcolor='silver'> <script> isc.TabSet.create({ ID: "tabSet", tabBarPosition: "top", width: 400, height: 200, tabs: [ {title: "Blue", canClose: true, pane: isc.Label.create({contents: "Happy Codings :-) JavaScript Code Examples"})}, {title: "Green", pane: isc.Label.create({contents: "Happy Codings :-) JavaScript Code Examples"})} ] }); isc.IButton.create({ title: "Add Tab", top: 225, click: function () { // alternate between yellow pawn and green cube if (tabSet.tabs.length % 2 == 0) { tabSet.addTab({ title: "Yellow", canClose: true, pane: isc.Label.create({contents: "Happy Codings :-) JavaScript Code Examples"}) }); } else { tabSet.addTab({ title: "Green", canClose: true, pane: isc.Label.create({contents: "Happy Codings :-)"}) }); } if (tabSet.tabs.length == 1) tabSet.selectTab(0); } }); isc.IButton.create({ title: "Remove Tab", top: 225, left: 110, click: function () { tabSet.removeTab(tabSet.tabs.length-1); } }); </script> </body> </html>