一般需要事先写好css样式等function tab(sId) { var tabs = document.getElementsByTagName(“H2”); var boxs = document.getElementsByTagName(“h3”); if ( boxs[sId].style.display==”block”){ boxs[sId].style.display=”none”; tabs[sId].style.backgroundColor=”#E3F4FE”; tabs[