DHTMLX Docs & Samples Explorer

Control over tabs

Control over tabs


For active tab:

For selected tab:

Source
<link rel="STYLESHEET" type="text/css" href="../../codebase/dhtmlxtabbar.css">
<script  src="../../codebase/dhtmlxcommon.js"></script>
<script  src="../../codebase/dhtmlxtabbar.js"></script>
 
<h1 id="init_tabbar_from_script">Control over tabs</h1>
<div id="a_tabbar" style="width:595px; height:190px;"></div>
        <br/>
For active tab:<br/>            
<input type='button' value='Set tab label' onclick='tabbar.setLabel(tabbar.getActiveTab(),this.nextSibling.value)'><input type="text" value='new label'><br>
For selected tab:    <br/>
<input type='button' value='Disable tab' onclick='tabbar.disableTab(this.nextSibling.nextSibling.value,true)'><input type='button' value='Enable tab' onclick='tabbar.enableTab(this.nextSibling.value)'><select>
    <option value="a1">a1</option>
    <option value="a2">a2</option>
    <option value="a3">a3</option>
    <option value="a4">a4</option>
    <option value="a5">a5</option>
</select><br/>
<input type='button' value='Hide tab' onclick='tabbar.hideTab(this.nextSibling.nextSibling.value,true)'><input type='button' value='Show tab' onclick='tabbar.showTab(this.nextSibling.value)'><select>
    <option value="a1">a1</option>
    <option value="a2">a2</option>
    <option value="a3">a3</option>
    <option value="a4">a4</option>
    <option value="a5">a5</option>
</select>
 
 
 
<script>
tabbar = new dhtmlXTabBar("a_tabbar", "top");
tabbar.setSkin('dhx_skyblue');
tabbar.setImagePath("../../codebase/imgs/");
tabbar.addTab("a1", "Tab 1-1", "100px");
tabbar.addTab("a2", "Tab 1-2", "100px");
tabbar.addTab("a3", "Tab 1-3", "100px");
tabbar.addTab("a4", "Tab 1-4", "100px");
tabbar.addTab("a5", "Tab 1-5", "100px");
tabbar.setTabActive("a1");
</script>