当我单击任何链接时,会显示相应的 div,但是当我单击下一个链接时,会显示新单击的潜水以及先前单击的潜水。我想隐藏 previos div。新的开发请有人帮助我........
这是链接的 html 代码:
<a class="hide" onclick="showdiv('firstimpression'); " href="#">First Impression</a>
<a class="hide" onclick="showdiv('speaking'); " href="#">Speaking</a>
<a class="hide" onclick="showdiv('eating'); " href="#">Eating</a>
<a class="hide" onclick="showdiv('taste'); " href="#">Taste</a>
<a class="hide" onclick="showdiv('saliva'); " href="#">Saliva</a>
<a class="hide" onclick="showdiv('cleaning');" href="#">Cleaning</a>
<a class="hide" onclick="showdiv('nighttime');" href="#">Night Time</a>
<a class="hide" onclick="showdiv('singledenture');" href="#">Single Denture</a>
<a class="hide" onclick="showdiv('soreness');" href="#">Soreness</a>
<a class="hide" onclick="showdiv('burning');" href="#">Burning</a>
<a class="hide" onclick="showdiv('adapting');" href="#">Adapting</a>
<a class="hide" onclick="showdiv('futureconsideration');" href="#">Future Consideration</a>
<a class="hide" onclick="showdiv('conclusion');" href="#">Conclusion</a>
这些是div:
<div id="firstimpression" class="patientinfodivs">
<div id="speaking" class="patientinfodivs">
.....等等
Javascript代码
<script type="text/javascript">
function showdiv(id){
document.getElementById(id).style.display = "block";
}
</script>