我是刚学javascript的,谁能帮我啊

解决方案 »

  1.   

    利用div分组控件,然后根据条件控制各分组的显示.
      

  2.   

    用这个死办法吧:<input type=button onClick="chgSel()">
    <form name=test>
    <select id=SEL>
    <option selected>&nbsp;</option>
    <option>v1</option>
    <option>v2</option>
    <option>v3</option>
    <option>v4</option>
    </select>
    </form>
    </BODY>
    </HTML>
    <script language="javascript">
    function chgSel(){
    var userA="1",userB="2",userC="3";
    var curUser=userC;//假设用户是C
    if(curUser=="1"){
    test.innerHTML="<select><option selected>&nbsp;</option><option>V1</option></select>";
    }
    else if(curUser=="2"){
    test.innerHTML="<select><option selected>&nbsp;</option><option>V1</option><option>V2</option></select>";
    }
    else{
    test.innerHTML="<select><option selected>&nbsp;</option><option>V1</option><option>V2</option><option>V3</option></select>";
    }
    }
    </script>