我在我的
页面上有一组动态
生成的下拉框。基本上我克隆他们使用jQuery。现在我想捕获在每个下拉选择的更改事件的值。
我尝试这样的东西没有工作。
$('._someDropDown').live('change',function(e) {
//debugger;
var v = $(this);
alert($(this + ':selected').val());
alert($(this).val());
});
我如何完成它?
这是你需要的:)
$('._someDropDown').live('change',function(e) {
console.log(e.target.options[e.target.selectedindex].text);
});
对于新的jQuery使用
$(document).on('change','._someDropDown',function(e) {
console.log(this.options[e.target.selectedindex].text);
});