Home > Web Front-end > JS Tutorial > js tab tab_javascript skills

js tab tab_javascript skills

WBOY
Release: 2016-05-16 18:53:51
Original
1583 people have browsed it

一般需要事先写好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[sId].style.color="#000000";
}
else{
boxs[sId].style.display="block";
tabs[sId].style.backgroundColor="#3575CC";
tabs[sId].style.color="#ffffff";
}
for (var i=0; iif ( i != sId) {
boxs[i].style.display = "none";
tabs[i].style.backgroundColor="#E3F4FE";
tabs[i].style.color="#000000";
}
}
}


中英合作自考







Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template