jquery can't get the change event on select element
- by user63898
i have this code the jquery code never got triggered
none of the scripts are triggered :
$('select[name=privileges]').change(function(){
alert("id");
var id = $(this).find(':selected')[0].id;
alert(id);
$('#changevalue').val(id);
})
or this:
$("#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>
in the end i like to send the selected option id in the form get