hello all
I am using tab panel in my
jsp .
For that when my responce come from back end
I have to activate second tab dynamically.
Here is my code for tab
html code
<div id='tab-container'>
<div class="tab-content" id="buyer">
Buy Services
</div>
<div class="tab-content" id="seller">
Sell Services
</div>
</div>
-----And Javascript code is--------
function ActivateTab(containerId, activeTabIndex)
{
alert('hi')
var i, tabContainer, tabContents;
tabContainer = document.getElementById(containerId);
if(tabContainer == null)
return;
tabContents = getChildElementsByClassName(tabContainer, 'tab-content');
alert(activeTabIndex)
if(tabContents.length > 0)
{
for(i = 0; i < tabContents.length; i++)
{
//tabContents[i].className = "tab-content";
tabContents[i].style.display = "none";
}
tabContents[activeTabIndex].style.display = "block";
tabList = document.getElementById(containerId + '-list');
tabs = getChildElementsByClassName(tabContainer, 'tab-item');
if(tabs.length > 0)
{
for(i = 0; i < tabs.length; i++)
{
tabs[i].className = "tab-item";
}
tabs[activeTabIndex].className = "tab-item tab-active";
tabs[activeTabIndex].blur();
}
}
}
So please help me how can i do. Can i write something in div tag for activate
tab.? If its possble then please help ma.