<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>无标题文档</title>
</head>
<script language="JavaScript" type="text/JavaScript">
function showhidediv(id)
{
var div_daxue=document.getElementById("daxuediv");
var div_zhuanye=document.getElementById("zhuanyediv");
if (id == 'daxue')
{
    daxuediv.style.display='block';
    zhuanyediv.style.display='none';
}
else
{
    daxuediv.style.display='none';
zhuanyediv.style.display='block';
}
}
</script>
<body>
大学<input id="daxue" name="Show" type="radio" value="daxue" onclick="showhidediv('daxue')" checked="checked" />
专业<input id="zhuanye" name="Show" type="radio" value="zhuanye" onclick="showhidediv('zhuanye')" />
<div id="daxuediv">
XX大学
</div>
<div id="zhuanyediv" style="display:none;">
XX专业
</div>
</body>
</html>
这段代码在IE中好使,但是在火狐里就不行,求高手指点,在线等!~

解决方案 »

  1.   

    表示firefox版本3.6.13  js能正常使用  但存在乱码问题
      

  2.   

    代码在firefox 6.0.2版本下正常 估计不是页面的问题吧
      

  3.   

    function showhidediv(id)
    {
    var div_daxue=document.getElementById("daxuediv");
    var div_zhuanye=document.getElementById("zhuanyediv");
    if (id == 'daxue')
    {
      div_daxue.style.display='block';
      div_zhuanye.style.display='none';
    }
    else
    {
      div_daxue.style.display='none';
    div_zhuanye.style.display='block';
    }
    }
      

  4.   

    感谢 javaniejian 问题解决~贴已结完!~