<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/2000/REC-xhtml1-20000126/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<script language="JavaScript" type="text/javascript">
var curr=null;
function initFaq(){
var faq=document.getElementById("faq");
var hs=faq.getElementsByTagName("h5");
var ps=faq.getElementsByTagName("p");
for (var i=0;i<hs.length;i++){
hs[i].onclick=function(){
if (curr!=null)
curr.nextSibling.style.display='none';
var s=this.nextSibling.style;
s.display=((s.display=='none')?'':'none');
if (s.display!='none')
curr=this;
else
curr=null;
}
hs[i].style.cursor='pointer';
ps[i].style.display='none';
}
}
</script>
</head>
<body onload="initFaq()">
<ul id="faq">
<li>
<h5>问题1</h5>
<p>答:1略略略略略略略略略略略略略略略略略略略略略略略略略略</p>
</li>
<li>
<h5>问题2</h5>
<p>答:2略略略略略略略略略略略略略略略略略略略略略略略略略略</p>
</li>
<li>
<h5>问题3</h5>
<p>答:3略略略略略略略略略略略略略略略略略略略略略略略略略略</p>
</li>
<li>
<h5>问题4</h5>
<p>答:4略略略略略略略略略略略略略略略略略略略略略略略略略略</p>
</li>
</ul>
</body>
</html>
posted on 2006-12-22 16:13
汪杰 阅读(1602)
评论(1) 编辑 收藏 引用 所属分类:
Dhtml DOm