我有这段代码 jquery 代码从未被触发 没有任何脚本被触发:
 $('select[name=privileges]').change(function(){
      alert("id");
            var id = $(this).find(':selected')[0].id;
            alert(id);
        $('#changevalue').val(id);
      }) 
或这个:
   $("#privileges_select").change(function() {
        alert($('#privileges_select option:selected').html());
     });
  <form method="GET" action="create_new_user.php">          
         user:<input  type="text" size="40"   name="user_name"/> 
         password:<input  type="text" size="40"   name="password"/>       
          <select name=privileges  id="privileges_select">
          <option name='opt_1'>admin</option>
              <option name='opt_2'>ordinary</option>            
             </select>
         <input type="hidden" name="item_options_id" value="" id="changevalue" />
          <input type="submit" value ="create" />
          <input type="reset" />
       </form>
最后,我喜欢以 get 的形式发送选定的选项 id