Je présume que votre question est que l'indéfini appel alert()
affiché au lieu de la valeur du <select>
.
Si vous voulez voir la valeur de la <select>
, faire à la place:
<select onchange="alert(this.value);">
<option>d</option>
<option>de</option>
<option>dewe</option>
<option>dewee</option>
</select>
jsfiddle example
Ou, si vous utilisez réellement jQuery, vous pouvez le faire comme ceci:
//This is an anonymous function that calls itself with the jQuery object as an argument
//This allows you to use the `$` when making jQuery calls but the code
//will run without modification if jQuery is in noConflict() mode
(function($) {
//This is the important part
//Here, we bind to the change event and alert the value
$('select').change(function(e) {
alert($(this).val());
});
})(jQuery)
jsfiddle example 2
Cela fonctionne pour moi. – bfavaretto
Il fait: http://jsfiddle.net/H4kuk/. – pimvdb
[Works] (http://jsfiddle.net/cggdc/) bien pour moi .. – Prisoner