//tabsId Id of the div containing the tab code. //srcId Id of the tab whose id you are looking for function id2Index(tabsId, srcId) { var index=-1; var i = 0, tbH = $(tabsId).find("li a"); var lntb=tbH.length; if(lntb>0){ for(i=0;i0){ index=i; } } } return index; }