当前位置:首页 > 用js实现select对div的隐藏与显示

用js实现select对div的隐藏与显示

点击次数:1781  更新日期:2011-01-05
\n

用js实现select对div的隐藏与显示


\n


\n

\n


\n

\n

<!DOCTYPE HTML PUBLIC “-//W3C//DTD HTML 4.01 Transitional//EN”
“http://www.w3.org/TR/html4/loose.dtd”>
<html>
<head>
<meta http-equiv=”Content-Type” content=”text/html; charset=gb2312″>
<title>无标题文档</title>
</head>


\n

<body>
\n


\n
\n

<script type=”text/javascript”>
function change(a){
var xxx = document.getElementById(“xxx”);
var divArray = xxx.getElementsByTagName(“div”);
for (var i=0;i<divArray.length;i++) {
if (divArray[i].id == a) {
divArray[i].style.display=”;
}else {
divArray[i].style.display=’none’;
}
}
}
</script>
\n

\n