我on()习惯于模仿live(),但终生无法弄清楚如何正确引用$(this),因此它引用了我传入的选择器。这是代码,$(this)返回"body"而不是"select".
$("body").on("change", "select", function(e){
console.log($(this));
});
试试这个
$(e.currentTarget);
e 实际上是事件的事件参数,这就是你想要我相信的。
您可以使用event.target作为事件的来源。
$("body").on("change", "select", function(e){
console.log($(e.target));
});