JavaScript:DIV . ID的用法。哪位有帮我看看?
<html>
<head>
<script language="javascript">
function show(ok) //????
{
for (i=0;i<3;i++) {
document.anchors[i].style.display="none";
}
document.all(ok).style.display="";
}
function closeall()
{
for (i=0;i<6;i++) {
document.anchors[i].style.display="none"; //???
}
}
function open()
{
for (i=0;i<6;i++) {
document.anchors[i].style.display="none"; //???
}
}
</script>
</head>
<body>
<DIV id="layer1">层1</DIV>
<DIV id="layer2">层2</DIV>
<DIV id="layer3">层3</DIV>
<DIV id="layer4">层4</DIV>
<DIV id="layer5">层5</DIV>
<DIV id="layer6">层6</DIV>
<DIV id="ok" name="kkk">上面的...</DIV>
<br>
<input type=button value="打开或关闭层3" onClick="show(layer3);">
<input type=button value="关闭所有的层" onClick="closeall();">
<input type=button value="打开层3并关闭其它所有的层" onClick="open(layer3);">
</body>
</html>
请问上面的show,closeall,open三个函数怎么写?
谢谢大虾们。