不知道哪里出问题了。找不出来了function showl()
{
    var obj=document.getElementById("leixing");


//alert (obj.options[obj.selectedIndex].value);//这个能打印出来 if(obj.options[obj.selectedIndex].value=="教职工")
{  alert(obj.options[obj.selectedIndex].value);//一到这就打不出来了。
   document.getElementById("jiaozhigong").style.display="";//导致后边这二个就不行
       document.getElementById("xues").style.display="none";
}
}

解决方案 »

  1.   

    这个明显说明 obj.options[obj.selectedIndex].value 和 "教职工" 不相等啊.你这里这个"教职工" 到底是value还是innerHTML不要搞错了
      

  2.   

    要么就是"教职工"中还有一些不可见的不符号.
    if(obj.options[obj.selectedIndex].value=="教职工")
    改成
    if(obj.options[obj.selectedIndex].value.indexOf("教职工") != -1)
    试试
      

  3.   


      <script type="text/javascript">
    function showl()
    {
     var obj=document.getElementById("leixing");
    alert(obj.options[obj.selectedIndex].value);
    if(obj.options[obj.selectedIndex].value=="教职工")//这个右括号错了,你打的是中文状态下的右括号

    alert(obj.options[obj.selectedIndex].value);
    document.getElementById("jiaozhigong").style.display="";
    document.getElementById("xues").style.display="none";
    }
    }
      </script>