ここにJSFiddleがありますが、新しいオブジェクトにクローンを作成せずにe.targetを置き換えることはできますか?
そのフィドルのリスナーは以下で繰り返されます。
one.addEventListener('click', function(e) {
// default behaviour, don't modify the event at all
logTarget(e);
});
two.addEventListener('click', function(e) {
// replace the value on the same object, which seems to be read-only
e.target = document.createElement('p');
logTarget(e);
});
three.addEventListener('click', function(e) {
function F(target) {
// set another property of the same name on an instance object
// which sits in front of our event
this.target = target;
}
// put the original object behind it on the prototype
F.prototype = e;
logTarget(new F(document.createElement('p')));
});
four.addEventListener('click', function(e) {
// create a new object with the event behind it on the prototype and
// our new value on the instance
logTarget(Object.create(e, {
target: document.createElement('p')
}));
});