【发布时间】:2021-02-15 13:00:09
【问题描述】:
制作方法:
$('.x').on('click', function() {
console.log($(this).attr('id'));
});
这样:
$('.x').on('click', () => {
console.log($(this).attr('id'));
});
但仍在工作?
【问题讨论】:
-
这能回答你的问题吗? Can you bind 'this' in an arrow function?
-
我不确定...
标签: jquery return click this bind