<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title>js显示隐藏层</title>
<script language="JavaScript" type="text/JavaScript">
<!--
function showDiv(_Id,obj){
var Target=document.getElementById(_Id);
var clickText=document.getElementById(obj)
if (Target.style.display=="block"){
Target.style.display="none";
clickText.innerText="+";//变回+
} else {
Target.style.display="block";
clickText.innerText="-";//变回-
}
}
-->
</script>
<style type="text/css">
<!--
body { font: normal 14px "宋体" }
a { text-decoration: none; }
#showtext1 { cursor: hand; cursor:pointer;}
#showtext2 { cursor: hand; cursor:pointer;}
#contentId { margin-top: 10px; width:100%; border: 1px solid #CCC; background: #F1F1F1; padding: 15px; }
#contentId2 { margin-top: 10px; width: 470px; border: 1px solid #CCC; background: #F1F1F1; padding: 15px; }
.none { display: none; }
-->
</style>
</head>
<body>
<a id="showtext1" onClick="showDiv('contentId','showtext1')">+</a>
<div id="contentId" class="none">打开的内容</div>
<p></p>
<a id="showtext2" onClick="showDiv('contentId2','showtext2')">+</a>
<div id="contentId2" class="none">打开的内容</div>
<p></p>
</body>
</html>