<p class="titbox h-tit onclicktab">
<span class="span1" οnclick="setTab('tab',1,2)" id="tab1">地01</span>
<span class="span2" οnclick="setTab('tab',2,2)" id="tab2">情况02</span>
</p>
function setTab(name,cursel,n){
for(i=1;i<=n;i++){
var menu=document.getElementById(name+i);
var con=document.getElementById("con_"+name+"_"+i);
menu.className = i==cursel?"selected":"";
con.style.display=i==cursel?"block":"none";
}
}