<select name="class_id" id="class_id" style="width:92px" onchange="if(this.selectedIndex==3) window.open('add_star.html','_self');">
IE不支持onclick

解决方案 »

  1.   


    <html>
    <head>
    <title></title>
    <script>
    function select(){
    var obj = document.getElementById("myselect").value;
    if(obj == "4" ){
    window.open('add_star.html','_self');
    }
    }
    </script>
    </head>
    <body>
    <select id="myselect" style="width:92px" onchange="select();"> 
          <option value="1">栏目1 </option> 
          <option value="2">栏目2 </option> 
          <option value="3">栏目3 </option> 
          <option value="4">栏目4 </option> 
    </select> 
    </body>
    </html>楼主,这样写,问题应该可以解决了
      

  2.   

    明白了,这个
    this.selectedIndex==3不是<option value="3">栏目3 </option> 里的3而是
    select index序列