我的页面上的各种元素都有内容可编辑标签。将一个on事件添加到e.currentTarget?
当他们被点击我这样做:
$('[contenteditable]').on('click', this.edit);
p.edit = function(e) {
console.log(e.currentTarget);
e.currentTarget.on('keydown', function() {
alert("keydown...");
});
};
我得到的当前目标确定,但是当我尝试的keydown添加到它,我得到的错误:
Uncaught TypeError: undefined is not a function
嗯,你要确保多个事件不附? – epascarello