如果这样做
$this.find('div').click(customFunc); // inside customFunc , $(this) is a div
如果这样做
$this.find('div').keypress(
function(e) {
customFunc();
}
); // inside customFunc , $(this) is a window
我想要在调用 keypress 时,在里面customFuc(), $(this)是div。
如何做到这一点并保持使用function(e)按键?